<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Information for Ghostscript developers</title>
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
<!-- $Id: Develop.htm,v 1.127 2003/12/08 23:17:15 giles Exp $ -->
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>Information for Ghostscript developers</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Introduction">Introduction</a>
<li><a href="#Architecture">Architecture</a>
<ul>
<li><a href="#Design_goals">Design goals</a>
<li><a href="#Design_principles">Design principles</a>
<li><a href="#Large_scale_structure">Large-scale structure</a>
<li><a href="#Object_oriented_constructs">Object-oriented constructs</a>
</ul>
<li><a href="#File_roadmap">File roadmap</a>
<ul>
<li><a href="#Substrate">Substrate</a>
<li><a href="#Graphics_library">Graphics library</a>
<ul>
<li><a href="#Library_support">Support</a>,
    <a href="#Paths">Paths</a>,
    <a href="#Text">Text</a>,
    <a href="#Images">Images</a>,
    <a href="#Paint">Paint</a>,
    <a href="#Clipping">Clipping</a>,
    <a href="#Other_graphics">Other graphics</a>,
    <a href="#Driver_support">Driver support</a>,
    <a href="#FAPI_support_gx">Font API support</a>
    <a href="#Visual_trace">Visual Trace</a>
</ul>
<li><a href="#Device_drivers">Device drivers</a>
<ul>
<li><a href="#Internal_devices">Internal devices</a>,
    <a href="#PS_and_PDF_writers">PostScript and PDF writers</a>,
    <a href="#High_level_devices">Other high-level devices</a>,
    <a href="#Other_maintained_drivers">Other maintained drivers</a>,
    <a href="#Contributed_drivers">Contributed drivers</a>
</ul>
<li><a href="#PostScript_interpreter">PostScript interpreter</a>
<ul>
<li><a href="#Main_program">Main program</a>,
    <a href="#Data_structures">Data structures</a>,
    <a href="#Stacks">Stacks</a>,
    <a href="#Interpreter_loop">Interpreter loop</a>,
    <a href="#Scanning_parsing">Scanning/parsing</a>,
    <a href="#Standard_operators">Standard operators</a>,
    <a href="#Non_standard_operators">Non-standard operators</a>,
    <a href="#Interpreter_support">Interpreter support</a>,
    <a href="#PostScript_code">PostScript code</a>
</ul>
<li><a href="#PDF_interpreter">PDF interpreter</a>
<li><a href="#Build_process">Build process</a>
<ul>
<li><a href="#Makefile_structure">Makefile structure</a>,
    <a href="#dev_files">.dev files</a>,
    <a href="#Generators">Generators</a>,
    <a href="#Build_support">Support</a>
</ul>
<li><a href="#Utilities">Utilities</a>
<ul>
<li><a href="#Utilities_in_PostScript">Utilities in PostScript</a>
<li><a href="#Utility_scripts">Utility scripts</a>
</ul>
</ul>
<li><a href="#Memory_management">Memory management</a>
<ul>
<li><a href="#Memory_manager_architecture">Memory manager architecture</a>
<ul>
<li><a href="#Objects_vs_strings">Objects vs strings</a>,
    <a href="#Structure_descriptors">Structure descriptors</a>,
    <a href="#Garbage_collection">Garbage collection</a>,
    <a href="#Movability">Movability</a>,
    <a href="#Parent_hierarchy">Parent hierarchy</a>,
    <a href="#Allocator_API">Allocator API</a>
</ul>
<li><a href="#Freeing_storage">Freeing storage</a>
<ul>
<li><a href="#Explicit_freeing">Explicit freeing</a>,
    <a href="#Reference_counting">Reference counting</a>,
    <a href="#Real_garbage_collection">(Real) garbage collection</a>
</ul>
<li><a href="#Special_implementations">Special implementations</a>
<ul>
<li><a href="#malloc">malloc</a>,
    <a href="#Locking">Locking</a>,
    <a href="#Retrying">Retrying</a>
</ul>
<li><a href="#Standard_implementation">Standard implementation</a>
<li><a href="#PostScript_interpreter_extensions">PostScript interpreter extensions</a>
<ul>
<li><a href="#Refs">Refs (PostScript "objects")</a>,
    <a href="#save_forgetsave_restore">save/.forgetsave/restore</a>,
    <a href="#Stable_allocators">Stable allocators</a>,
    <a href="#Interpreter_GC">Garbage collection</a>
</ul>
</ul>
<li><a href="#Portability">Portability</a>
<ul>
<li><a href="#Structural">Structural</a>
<ul>
<li><a href="#CPU_and_compiler">CPU and compiler</a>,
    <a href="#Library_headers">Library headers</a>,
    <a href="#Cross_platform_APIs">Cross-platform APIs</a>,
    <a href="#Makefiles">Makefiles</a>
</ul>
<li><a href="#Coding">Coding</a>
<ul>
<li><a href="#Explicit_dependencies">Explicit dependencies</a>,
    <a href="#Implicit_dependencies">Implicit dependencies</a>
</ul>
<li><a href="#Platform_specific_code">Platform-specific code</a>
</ul>
<li><a href="#Adding_features_and_options">Adding features and options</a>
<li><a href="#Troubleshooting">Troubleshooting</a>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a> and the documentation related to <a
href="Maintain.htm">maintaining Ghostscript</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="Introduction"></a>Introduction</h2>

<p>
This document provides a wealth of information about Ghostscript's
internals, primarily for developers actively working on Ghostscript.  It is
primarily <strong>descriptive</strong>, documenting the way things are; the
companion <a href="C-style.htm">C style guide</a> is primarily
<strong>prescriptive</strong>, documenting what developers should do when
writing new code.

<p>
THIS FILE IS A WORK IN PROGRESS.  MANY SECTIONS ARE PLACE-HOLDERS.

<h2><a name="Architecture"></a>Architecture</h2>

<h3><a name="Design_goals"></a>Design goals</h3>

<p>
Ghostscript has the following high-level design goals (not listed in order
of importance):

<ul>
<li>Functionality
<ul>
<li>Ability to interpret the current PostScript and PDF languages, as
defined (and occasionally, in the case of conflict, as implemented) by
Adobe.
<li>Ability to convert PostScript to and from PDF, comparable to
Adobe products.
<li>Ability to produce output for a wide range of resolutions (from
TV-resolution displays to imagesetters) and color models (black and white,
multilevel gray, bilevel or multi-level RGB and CMYK, 6- or 8-color
inkjet printers, spot color).
</ul>
<li>Performance
<ul>
<li>Ability to render PostScript and PDF with commercial-quality performance
(memory usage, speed, and output quality) on all platforms.
<li>Specifically, ability to render PostScript effectively in embedded
environments with constrained RAM, including the ability to put the code and
supporting data in ROM.
</ul>
<li>Licensing
<ul>
<li>Licensing that supports both the Open Source / Free software communities
and a commercial licensing business.
<li>Freedom from licensing restrictions or fees imposed by third parties.
</ul>
<li>Other
<ul>
<li>Easy source portability to any platform (CPU, operating system, and
development tools) that has an ANSI C compiler.
<li>Support for writing new interpreters and new drivers with no change to
any existing code; specifically, ability to support PCL 5e, PCL 5c, and PCL
XL interpreters, and the ever-changing roster of inkjet printers.
</ul>
</ul>

<p>
These goals often conflict: part of Ghostscript's claim to quality is that
the conflicts have been resolved well.

<h3><a name="Design_principles"></a>Design principles</h3>

<p>
Part of what has kept Ghostscript healthy through many years of major code
revisions and functional expansion is consistent and conscientious adherence
to a set of design principles.  We hope the following list captures the most
important ones.

<h4>Non-preemption</h4>

<p>
Ghostscript is designed to be used as a component.  As such, it must share
its environment with other components.  Therefore, it must not require
ownership of, or make decisions about, inherently shared resources.
Specifically, it must not assume that it can "own" either the locus of
control or the management of the address space.

<p>
Not owning control means that whenever Ghostscript passes control to its
caller, it must do so in a way that doesn't constrain what the caller can do
next.  The caller must be able to call any other piece of software, wait for
an external event, execute another task, etc., without having to worry about
Ghostscript being in an unknown state.  While this is easy to arrange in a
multi-threaded environment (by running Ghostscript in a separate thread),
multi-threading APIs are not well standardized at this time (December 2000),
and may not be implemented efficiently, or at all, on some platforms.
Therefore, Ghostscript must choose between only two options for interacting
with its caller: to <em>return</em>, preserving its own state in data
structures, or to <em>call back</em> through a caller-supplied procedure.
Calling back constrains the client program unacceptably: the callback
procedure only has the options of either returning, or aborting Ghostscript.
In particular, if it wants (for whatever reason) to multi-task Ghostscript
with another program, it cannot do so in general, especially if the other
program also uses callback rather than suspension.  Therefore, Ghostscript
tries extremely hard to return, rather than calling back, for all caller
interaction.  In particular:

<ul>

<li>For callers that want to pass input to Ghostscript piece by piece,
Ghostscript returns with an <b><tt>e_NeedInput</tt></b> code rather than
using a callback.  This allows the caller complete flexibility in its
control structure for managing the source of input.  (It might, for example,
be generating the input dynamically.)

<li>In the future, the same arrangement should be used for input from
<b><tt>stdin</tt></b> and output to <b><tt>stdout</tt></b> and
<b><tt>stderr</tt></b>.

<li>Likewise, scheduling of Ghostscript's own threads (contexts), currently
done with a callback, should be done with suspension.  The Display
Ghostscript project (GNU DGS) is working on this.

</ul>

<p>
The one area where suspension is not feasible with Ghostscript's current
architecture is device output.  Device drivers are called from deep within
the graphics library.  (If Ghostscript were being redesigned from scratch,
we might try to do this with suspension as well, or at least optional
suspension.)

<p>
Not owning management of the address space means that even though
Ghostscript supports garbage collection for its own data, it must not do any
of the things that garbage collection schemes for C often require: it must
not replace 'malloc' and 'free', must not require its clients to use its own
allocator, must not rely on manipulating the read/write status of memory
pages, must not require special compiler or run-time support (e.g., APIs for
scanning the C stack), must not depend on the availability of
multi-threading, and must not take possession of one of a limited number of
timer interrupts.  However, in order not to constrain its own code unduly,
it must also not require using special macros or calls to enter or leave
procedures or assign pointers, and must not constrain the variety of C data
structures any more than absolutely necessary.  It achieves all of these
goals, at the expense of some complexity, some performance cost (mostly for
garbage collection), and some extra manual work required for each structure
type allocated by its allocator.  The details appear in the <a
href="#Memory_management">Memory management</a> section below.

<h4>Multi-instantiability</h4>

<p>
From many years of experience with the benefits of object-oriented design,
we have learned that when the word "the" appears in a software design --
"the" process scheduler, "the" memory manager, "the" output device, "the"
interpreter, "the" stack -- it often flags an area in which the software
will have difficulty adapting to future needs.  For this reason, Ghostscript
attempts to make every internal structure capable of existing in multiple
instances.  For example, Ghostscript's memory manager is not a one-of-a-kind
entity with global state and procedures: it is (or rather they are, since
Ghostscript has multiple memory managers, some of which have multiple
instances) objects with their own state and (virtual) procedures.
Ghostscript's PostScript interpreter has no writable non-local data
(necessary, but not sufficient, to allow multiple instances), and in the
future will be extended to be completely reentrant and instantiable.  The
device driver API is designed to make this easy for drivers as well.  The
graphics library is currently not completely reentrant or instantiable: we
hope this will occur in the future.

<h4>Late configuration binding</h4>

<p>
Ghostscript is designed to make configuration choices as late as possible,
subject to simplicity and performance considerations.  The major binding
times for such choices are compilation, linking, startup, and dynamic.

<ul>

<li>Compilation binds only CPU and compiler characteristics (including data
type size, presence of floating point hardware, and data alignment), and
whether the code will be used for production, debugging, or profiling.

<li>Linking binds the choice of what features and device drivers will be
included in the executable.  (Work is underway to make the choice of drivers
dynamic.)

<li>Startup binds essentially nothing.  Almost every option and parameter
that can appear on the command line can also be changed dynamically.

<li>The selection of output device, all parameters associated with the
device, the selection of debugging printout and self-checking (in debugging
configurations), the macro-allocation of memory, and almost all other
operational parameters are dynamic.

</ul>

<p>
In addition, a number of major implementation decisions are made dynamically
depending on the availability of resources.  For example, Ghostscript
chooses between banded and non-banded rendering depending on memory
availability.

<h3><a name="Large_scale_structure"></a>Large-scale structure</h3>

<p>
At the largest design scale, Ghostscript consists of 4 layers.  Layer N
is allowed to use the facilities of all layers M &lt;= N.

<ol>

<li>The bottom layer is called the <a href="#Substrate">substrate</a>.  It
includes facilities like memory management, streams, fixed-point arithmetic,
and low-level interfaces to the operating system.  The substrate is written
in C, with a little C++ and/or assembler code for some platforms.

<li>The layer above the substrate is the graphics layer.  It consists of two
separate sub-parts.  The graphics layer is written in C.

<ul>

<li>The <a href="#Graphics_library">graphics library</a> manages graphics
state information for, and decomposes and renders 2-D images described
using, a graphics model that is approximately the union of those of
PostScript, PDF, and PCL 5e/5c/XL.

<li>The <a href="#Device_drivers">device drivers</a> are called by the
graphics library to produce actual output.  The graphics library, and all
higher layers, call device driver procedures only through virtual functions.

</ul>

<li>The principal clients of the graphics layer are language interpreters.
Ghostscript as distributed includes the <a
href="#PostScript_interpreter">PostScript interpreter</a>; there are also
interpreters for PCL 5e, PCL 5c, and PCL XL, which are not currently freely
redistributable and are not included in the standard Ghostscript package.
The PostScript interpreter is written partly in C and partly in PostScript.

<li>The <a href="#PDF_interpreter">PDF interpreter</a> is actually a client
of the PostScript interpreter: it is written entirely in PostScript.

</ol>

<p>
The most important interface in Ghostscript is the API between the graphics
library and the device drivers: new printers (and, to a lesser extent,
window systems, displays, plotters, film recorders, and graphics file
formats) come on the scene frequently, and it must be possible to produce
output for them with a minimum of effort and distruption.  This API is the
only one that is extensively documented (see <a
href="Drivers.htm">Drivers.htm</a>) and kept stringently backward-compatible
through successive releases.

<h3><a name="Object_oriented_constructs"></a>Object-oriented constructs</h3>

<p>
Ghostscript makes heavy use of object-oriented constructs, including
analogues of classes, instances, subclassing, and class-associated
procedures.  Since Ghostscript is written in C, not C++, implementing these
constructs requires following coding conventions.  The <a
href="C-style.htm#Objects">"Objects"</a> section of the C style guide
explains these.

<p>
The memory manager API provides run-time type information about each class,
but this information does not include anything about subclassing.  See under
<a href="#Structure_descriptors">Structure descriptors</a> below.

<hr>

<h2><a name="File_roadmap"></a>File roadmap</h2>

<p>
This section of the document provides a roadmap to all of the Ghostscript
source files.

<h3><a name="Substrate"></a>Substrate</h3>

<h4>Memory manager</h4>

<p>
See <a href="#Memory_management">below</a>.

<h4>Streams</h4>

<dl>

<dt>
Framework, file and string streams:
<dd>
<a href="../src/gsdsrc.c">src/gsdsrc.c</a>,
<a href="../src/gsdsrc.h">src/gsdsrc.h</a>,
<a href="../src/scommon.h">src/scommon.h</a>,
<a href="../src/sfxboth.c">src/sfxboth.c</a>,
<a href="../src/sfxfd.c">src/sfxfd.c</a>,
<a href="../src/sfxstdio.c">src/sfxstdio.c</a>,
<a href="../src/stream.h">src/stream.h</a>,
<a href="../src/stream.c">src/stream.c</a>,
<a href="../src/strimpl.h">src/strimpl.h</a>.

<dt>
Standard filters:
<dd>

<dl>

<dt>
CCITTFax:
<dd>
<a href="../src/scf.h">src/scf.h</a>,
<a href="../src/scfd.c">src/scfd.c</a>,
<a href="../src/scfdgen.c">src/scfdgen.c</a>,
<a href="../src/scfdtab.c">src/scfdtab.c</a>,
<a href="../src/scfe.c">src/scfe.c</a>,
<a href="../src/scfetab.c">src/scfetab.c</a>,
<a href="../src/scfparam.c">src/scfparam.c</a>,
<a href="../src/scfx.h">src/scfx.h</a>.

<dt>
DCT (JPEG):
<dd>
<a href="../src/gsjconf.h">src/gsjconf.h</a>,
<a href="../src/gsjmorec.h">src/gsjmorec.h</a>,
<a href="../src/sdcparam.c">src/sdcparam.c</a>,
<a href="../src/sdcparam.h">src/sdcparam.h</a>,
<a href="../src/sdct.h">src/sdct.h</a>,
<a href="../src/sdctc.c">src/sdctc.c</a>,
<a href="../src/sdctd.c">src/sdctd.c</a>,
<a href="../src/sdcte.c">src/sdcte.c</a>,
<a href="../src/sddparam.c">src/sddparam.c</a>,
<a href="../src/sdeparam.c">src/sdeparam.c</a>,
<a href="../src/sjpeg.h">src/sjpeg.h</a>,
<a href="../src/sjpegc.c">src/sjpegc.c</a>,
<a href="../src/sjpegd.c">src/sjpegd.c</a>,
<a href="../src/sjpege.c">src/sjpege.c</a>.

<dt>
JBIG2:
<a href="../src/sjbig2.h">src/sjbig2.h</a>,
<a href="../src/sjbig2.c">src/sjbig2.c</a>.

<dt>
Other compression/decompression:
<dd>
<a href="../src/slzwc.c">src/slzwc.c</a>,
<a href="../src/slzwce.c">src/slzwce.c</a>,
<a href="../src/slzwd.c">src/slzwd.c</a>,
<a href="../src/slzwx.h">src/slzwx.h</a>,
<a href="../src/srld.c">src/srld.c</a>,
<a href="../src/srle.c">src/srle.c</a>,
<a href="../src/srlx.h">src/srlx.h</a>.

<dt>
Other:
<dd>
<a href="../src/sa85d.c">src/sa85d.c</a>,
<a href="../src/sa85d.h">src/sa85d.h</a>,
<a href="../src/sa85x.h">src/sa85x.h</a>,
<a href="../src/sfilter1.c">src/sfilter1.c</a>,
<a href="../src/sfilter2.c">src/sfilter2.c</a>,
<a href="../src/sstring.c">src/sstring.c</a>,
<a href="../src/sstring.h">src/sstring.h</a>.

</dl>

<dt>
Non-standard filters used to implement standard filters:
<dd>
<a href="../src/seexec.c">src/seexec.c</a>,
<a href="../src/sfilter.h">src/sfilter.h</a>,
<a href="../src/shc.c">src/shc.c</a>,
<a href="../src/shc.h">src/shc.h</a>,
<a href="../src/shcgen.c">src/shcgen.c</a>,
<a href="../src/shcgen.h">src/shcgen.h</a>,
<a href="../src/spdiff.c">src/spdiff.c</a>,
<a href="../src/spdiffx.h">src/spdiffx.h</a>,
<a href="../src/spngp.c">src/spngp.c</a>,
<a href="../src/spngpx.h">src/spngpx.h</a>,
<a href="../src/szlibc.c">src/szlibc.c</a>,
<a href="../src/szlibd.c">src/szlibd.c</a>,
<a href="../src/szlibe.c">src/szlibe.c</a>,
<a href="../src/szlibx.h">src/szlibx.h</a>,
<a href="../src/szlibxx.h">src/szlibxx.h</a>.

<dt>
Non-standard filters:
<dd>
<a href="../src/sbcp.c">src/sbcp.c</a>,
<a href="../src/sbcp.h">src/sbcp.h</a>,
<a href="../src/sbhc.c">src/sbhc.c</a>,
<a href="../src/sbhc.h">src/sbhc.h</a>,
<a href="../src/sbtx.h">src/sbtx.h</a>,
<a href="../src/sbwbs.c">src/sbwbs.c</a>,
<a href="../src/sbwbs.h">src/sbwbs.h</a>,
<a href="../src/smd5.c">src/smd5.c</a>,
<a href="../src/smd5.h">src/smd5.h</a>,
<a href="../src/sarc4.c">src/sarc4.c</a>,
<a href="../src/sarc4.h">src/sarc4.h</a>,
<a href="../src/smtf.c">src/smtf.c</a>,
<a href="../src/smtf.h">src/smtf.h</a>.

<dt>
Internal filters:
<dd>
a<a href="../src/siinterp.c">src/siinterp.c</a>,
<a href="../src/siinterp.h">src/siinterp.h</a>,
<a href="../src/siscale.c">src/siscale.c</a>,
<a href="../src/siscale.h">src/siscale.h</a>,
<a href="../src/sisparam.h">src/sisparam.h</a>.

<dt>
Higher-level stream support:
<dd>
<a href="../src/spprint.c">src/spprint.c</a>,
<a href="../src/spprint.h">src/spprint.h</a>,
<a href="../src/spsdf.c">src/spsdf.c</a>,
<a href="../src/spsdf.h">src/spsdf.h</a>,
<a href="../src/srdline.h">src/srdline.h</a>.

</dl>

<h4>Platform-specific code</h4>

See <a href="#Cross_platform_APIs">below</a>.

<h4>Miscellaneous</h4>

<dl>

<dt>
Library top level:
<dd>
<a href="../src/gsinit.c">src/gsinit.c</a>,
<a href="../src/gslib.h">src/gslib.h</a>.

<dt>
Configuration-related:
<dd>
<a href="../src/gconf.c">src/gconf.c</a>,
<a href="../src/gconf.h">src/gconf.h</a>,
<a href="../src/gscdef.c">src/gscdef.c</a>,
<a href="../src/gscdefs.h">src/gscdefs.h</a>.

<dt>
Arithmetic:
<dd>
<a href="../src/gsfemu.c">src/gsfemu.c</a>,
<a href="../src/gxarith.h">src/gxarith.h</a>,
<a href="../src/gxdda.h">src/gxdda.h</a>,
<a href="../src/gxfarith.h">src/gxfarith.h</a>,
<a href="../src/gxfixed.h">src/gxfixed.h</a>,
<a href="../src/gxfrac.h">src/gxfrac.h</a>.

<dt>
Operating system interface:
<dd>
<a href="../src/gserror.h">src/gserror.h</a>,
<a href="../src/gsexit.h">src/gsexit.h</a>,
<a href="../src/gxstdio.h">src/gxstdio.h</a>,
<a href="../src/gxsync.c">src/gxsync.c</a>,
<a href="../src/gxsync.h">src/gxsync.h</a>.

<dt>
Other:
<dd>
<a href="../src/gsargs.c">src/gsargs.c</a>,
<a href="../src/gsargs.h">src/gsargs.h</a>,
<a href="../src/gserrors.h">src/gserrors.h</a>,
<a href="../src/gsnotify.c">src/gsnotify.c</a>,
<a href="../src/gsnotify.h">src/gsnotify.h</a>,
<a href="../src/gsrect.h">src/gsrect.h</a>,
<a href="../src/gstypes.h">src/gstypes.h</a>,
<a href="../src/gsuid.h">src/gsuid.h</a>,
<a href="../src/gsutil.h">src/gsutil.h</a>,
<a href="../src/gsutil.c">src/gsutil.c</a>,
<a href="../src/gx.h">src/gx.h</a>,
<a href="../src/md5.c">src/md5.c</a>,
<a href="../src/md5.h">src/md5.h</a>,
<a href="../src/md5main.c">src/md5main.c</a>.

</dl>

<h3><a name="Graphics_library"></a>Graphics library</h3>

<h4><a name="Library_support"></a>Support</h4>

<dl>

<dt>
Bitmap processing:
<dd>
<a href="../src/gsbitcom.c">src/gsbitcom.c</a>,
<a href="../src/gsbitmap.h">src/gsbitmap.h</a>,
<a href="../src/gsbitops.c">src/gsbitops.c</a>,
<a href="../src/gsbitops.h">src/gsbitops.h</a>,
<a href="../src/gsbittab.c">src/gsbittab.c</a>,
<a href="../src/gsbittab.h">src/gsbittab.h</a>,
<a href="../src/gsflip.c">src/gsflip.c</a>,
<a href="../src/gsflip.h">src/gsflip.h</a>,
<a href="../src/gxbitmap.h">src/gxbitmap.h</a>,
<a href="../src/gxbitops.h">src/gxbitops.h</a>,
<a href="../src/gxsample.c">src/gxsample.c</a>,
<a href="../src/gxsample.h">src/gxsample.h</a>.

<dt>
Functions:
<dd>
<a href="../src/gsfunc.c">src/gsfunc.c</a>,
<a href="../src/gsfunc.h">src/gsfunc.h</a>,
<a href="../src/gsfunc0.c">src/gsfunc0.c</a>,
<a href="../src/gsfunc0.h">src/gsfunc0.h</a>,
<a href="../src/gsfunc3.c">src/gsfunc3.c</a>,
<a href="../src/gsfunc3.h">src/gsfunc3.h</a>,
<a href="../src/gsfunc4.c">src/gsfunc4.c</a>,
<a href="../src/gsfunc4.h">src/gsfunc4.h</a>,
<a href="../src/gxfunc.h">src/gxfunc.h</a>.

<dt>
Parameter lists:
<dd>
<a href="../src/gscparam.c">src/gscparam.c</a>,
<a href="../src/gsparam.c">src/gsparam.c</a>,
<a href="../src/gsparam.h">src/gsparam.h</a>,
<a href="../src/gsparam2.c">src/gsparam2.c</a> (not used),
<a href="../src/gsparams.c">src/gsparams.c</a>,
<a href="../src/gsparams.h">src/gsparams.h</a>,
<a href="../src/gsparamx.c">src/gsparamx.c</a>,
<a href="../src/gsparamx.h">src/gsparamx.h</a>.

<dt>
I/O-related:
<dd>
<a href="../src/gdevpipe.c">src/gdevpipe.c</a>,
<a href="../src/gsfname.c">src/gsfname.c</a>,
<a href="../src/gsfname.h">src/gsfname.h</a>,
<a href="../src/gsio.h">src/gsio.h</a>,
<a href="../src/gsiodev.c">src/gsiodev.c</a>,
<a href="../src/gsiodevs.c">src/gsiodevs.c</a>,
<a href="../src/gsiodisk.c">src/gsiodisk.c</a>,
<a href="../src/gxiodev.h">src/gxiodev.h</a>.

</dl>

<h4><a name="Paths"></a>Paths</h4>

<dl>

<dt>
Coordinate transformation:
<dd>
<a href="../src/gscoord.c">src/gscoord.c</a>,
<a href="../src/gscoord.h">src/gscoord.h</a>,
<a href="../src/gsmatrix.c">src/gsmatrix.c</a>,
<a href="../src/gsmatrix.h">src/gsmatrix.h</a>,
<a href="../src/gxcoord.h">src/gxcoord.h</a>,
<a href="../src/gxmatrix.h">src/gxmatrix.h</a>.

<dt>
Path building:
<dd>
<a href="../src/gsdps1.c">src/gsdps1.c</a>,
<a href="../src/gspath.c">src/gspath.c</a>,
<a href="../src/gspath.h">src/gspath.h</a>,
<a href="../src/gspath1.c">src/gspath1.c</a>,
<a href="../src/gspath2.h">src/gspath2.h</a>,
<a href="../src/gxpath.c">src/gxpath.c</a>,
<a href="../src/gxpath.h">src/gxpath.h</a>,
<a href="../src/gxpath2.c">src/gxpath2.c</a>,
<a href="../src/gxpcopy.c">src/gxpcopy.c</a>,
<a href="../src/gxpdash.c">src/gxpdash.c</a>,
<a href="../src/gxpflat.c">src/gxpflat.c</a>,
<a href="../src/gzpath.h">src/gzpath.h</a>.

<dt>
Path rendering:
<dd>
<a href="../src/gdevddrw.c">src/gdevddrw.c</a>,
<a href="../src/gdevddrw.h">src/gdevddrw.h</a>,
<a href="../src/gxdtfill.h">src/gxdtfill.h</a>,
<a href="../src/gsdps1.c">src/gsdps1.c</a>,
<a href="../src/gspaint.c">src/gspaint.c</a>,
<a href="../src/gspaint.h">src/gspaint.h</a>,
<a href="../src/gspenum.h">src/gspenum.h</a>,
<a href="../src/gxfill.c">src/gxfill.c</a>,
<a href="../src/gxfill.h">src/gxfill.h</a>,
<a href="../src/gxfdrop.c">src/gxdrop.c</a>,
<a href="../src/gxfdrop.h">src/gxdrop.h</a>,
<a href="../src/gxpaint.c">src/gxpaint.c</a>,
<a href="../src/gxpaint.h">src/gxpaint.h</a>,
<a href="../src/gxstroke.c">src/gxstroke.c</a>,
<a href="../src/gzspotan.c">src/gzspotan.c</a>,
<a href="../src/gzspotan.h">src/gzspotan.h</a>.

<dt>
Clipping:
<dd>
See under <a href="#Clipping">Clipping</a> below.

</dl>

<h4><a name="Text"></a>Text</h4>

<dl>

<dt>
Fonts, generic:
<dd>
<a href="../src/gsfont.c">src/gsfont.c</a>,
<a href="../src/gsfont.h">src/gsfont.h</a>,
<a href="../src/gxfcopy.c">src/gxfcopy.c</a>,
<a href="../src/gxfcopy.h">src/gxfcopy.h</a>,
<a href="../src/gxfont.h">src/gxfont.h</a>.

<dt>
Fonts, specific FontTypes:
<dd>
<a href="../src/gsfcid.c">src/gsfcid.c</a>,
<a href="../src/gsfcid2.c">src/gsfcid.c</a>,
<a href="../src/gsfcmap.c">src/gsfcmap.c</a>,
<a href="../src/gsfcmap1.c">src/gsfcmap1.c</a>,
<a href="../src/gsfcmap.h">src/gsfcmap.h</a>,
<a href="../src/gsfont0.c">src/gsfont0.c</a>,
<a href="../src/gsfont0c.c">src/gsfont0.c</a>,
<a href="../src/gxcid.h">src/gxcid.h</a>,
<a href="../src/gxfcid.h">src/gxfcid.h</a>,
<a href="../src/gxfcmap.h">src/gxfcmap.h</a>,
<a href="../src/gxfcmap1.h">src/gxfcmap1.h</a>,
<a href="../src/gxfont0.h">src/gxfont0.h</a>,
<a href="../src/gxfont0c.h">src/gxfont0c.h</a>,
<a href="../src/gxfont1.h">src/gxfont1.h</a>,
<a href="../src/gxfont42.h">src/gxfont42.h</a>,
<a href="../src/gxftype.h">src/gxftype.h</a>,
<a href="../src/gxttf.h">src/gxttf.h</a>.

<dt>
Character rendering + font cache, generic:
<dd>
<a href="../src/gsccode.h">src/gsccode.h</a>,
<a href="../src/gschar.c">src/gschar.c</a>,
<a href="../src/gschar.h">src/gschar.h</a>,
<a href="../src/gscpm.h">src/gscpm.h</a>,
<a href="../src/gsgdata.c">src/gsgdata.c</a>,
<a href="../src/gsgdata.h">src/gsgdata.h</a>,
<a href="../src/gsgcache.c">src/gsgcache.c</a>,
<a href="../src/gsgcache.h">src/gsgcache.h</a>,
<a href="../src/gstext.c">src/gstext.c</a>,
<a href="../src/gstext.h">src/gstext.h</a>,
<a href="../src/gxbcache.c">src/gxbcache.c</a>,
<a href="../src/gxbcache.h">src/gxbcache.h</a>,
<a href="../src/gxccache.c">src/gxccache.c</a>,
<a href="../src/gxccman.c">src/gxccman.c</a>,
<a href="../src/gxchar.c">src/gxchar.c</a>,
<a href="../src/gxchar.h">src/gxchar.h</a>,
<a href="../src/gxfcache.h">src/gxfcache.h</a>,
<a href="../src/gxtext.h">src/gxtext.h</a>.

<dt>
Character rendering, specific FontTypes:
<dd>
<a href="../src/gschar0.c">src/gschar0.c</a>,
<a href="../src/gscrypt1.c">src/gscrypt1.c</a>,
<a href="../src/gscrypt1.h">src/gscrypt1.h</a>,
<a href="../src/gstype1.c">src/gstype1.c</a>,
<a href="../src/gstype1.h">src/gstype1.h</a>,
<a href="../src/gstype2.c">src/gstype2.c</a>,
<a href="../src/gstype42.c">src/gstype42.c</a>,
<a href="../src/gxchrout.c">src/gxchrout.c</a>,
<a href="../src/gxchrout.h">src/gxchrout.h</a>,
<a href="../src/gxhint1.c">src/gxhint1.c</a>,
<a href="../src/gxhint2.c">src/gxhint2.c</a>,
<a href="../src/gxhint3.c">src/gxhint3.c</a>,
<a href="../src/gxhintn.h">src/gxhintn.h</a>,
<a href="../src/gxhintn.c">src/gxhintn.c</a>,
<a href="../src/gxop1.h">src/gxop1.h</a>,
<a href="../src/gxtype1.c">src/gxtype1.c</a>,
<a href="../src/gxtype1.h">src/gxtype1.h</a>.

</dl>

<h4><a name="Images"></a>Images</h4>

<dl>

<dt>
Buffered API (mostly for PostScript interpreter):
<dd>
<a href="../src/gsimage.c">src/gsimage.c</a>,
<a href="../src/gsimage.h">src/gsimage.h</a>.

<dt>
Generic support:
<dd>
<a href="../src/gsiparam.h">src/gsiparam.h</a>,
<a href="../src/gxiclass.h">src/gxiclass.h</a>,
<a href="../src/gximage.c">src/gximage.c</a>,
<a href="../src/gximage.h">src/gximage.h</a>,
<a href="../src/gxiparam.h">src/gxiparam.h</a>.

<dt>
Type 1 and 4 images:
<dd>

<dl>

<dt>
Setup:
<dd>
<a href="../src/gsiparm4.h">src/gsiparm4.h</a>,
<a href="../src/gximage1.c">src/gximage1.c</a>,
<a href="../src/gximage4.c">src/gximage4.c</a>.

<dt>
Rendering:
<dd>
<a href="../src/gxi12bit.c">src/gxi12bit.c</a>,
<a href="../src/gxicolor.c">src/gxicolor.c</a>,
<a href="../src/gxidata.c">src/gxidata.c</a>,
<a href="../src/gxifast.c">src/gxifast.c</a>,
<a href="../src/gximono.c">src/gximono.c</a>,
<a href="../src/gxino12b.c">src/gxino12b.c</a>,
<a href="../src/gxipixel.c">src/gxipixel.c</a>,
<a href="../src/gxiscale.c">src/gxiscale.c</a>.

</dl>

<dt>
Type 2 images (Display PostScript):
<dd>
<a href="../src/gsiparm2.h">src/gsiparm2.h</a>,
<a href="../src/gximage2.c">src/gximage2.c</a>.

<dt>
Type 3 images:
<dd>
<a href="../src/gsipar3x.h">src/gsipar3x.h</a>,
<a href="../src/gsiparm3.h">src/gsiparm3.h</a>,
<a href="../src/gximag3x.c">src/gximag3x.c</a>,
<a href="../src/gximag3x.h">src/gximag3x.h</a>,
<a href="../src/gximage3.c">src/gximage3.c</a>,
<a href="../src/gximage3.h">src/gximage3.h</a>.

<dt>
Other:
<dd>
<a href="../src/gsimpath.c">src/gsimpath.c</a>.

</dl>

<h4><a name="Paint"></a>Paint</h4>

<p>
Ghostscript uses 4 internal representations of color.  We list them here in
the order in which they occur in the rendering pipeline.

<ol>

<li>Clients of the graphics library normally specify colors using the
<em>client color</em> structure (<b><tt>gs_client_color</tt></b>, defined in
<a href="../src/gsccolor.h">src/gsccolor.h</a>), consisting of one or more
numeric values and/or a pointer to a Pattern instance.  This corresponds
directly to the values that would be passed to the PostScript
<b><tt>setcolor</tt></b> operator: one or more (floating-point) numeric
components and/or a Pattern.  Client colors are interpreted relative to a
color space (<b><tt>gs_color_space</tt></b>, defined in <a
href="../src/gscspace.h">src/gscspace.h</a> and <a
href="../src/gxcspace.h">src/gxcspace.h</a>, with specific color spaces
defined in other files).  Client colors do not explicitly reference the
color space in which they are are interpreted: <b><tt>setcolor</tt></b> uses
the color space in the graphics state, while images and shadings explicitly
specify the color space to be used.

<li>For ordinary non-Pattern colors, the first step in color rendering
reduces a client color to a <em>concrete</em> color -- a set of values in a
color space that corresponds to the device's color model (except for
possible conversions between DeviceGray, DeviceRGB, and DeviceCMYK),
together with an identification of the associated color space.  (The
confusion here between color spaces and color models will have to be cleaned
up when we implement native Separation/DeviceN colors.)  Concrete colors are
like the numeric values in a client color, except that they are represented
by arrays of <b><tt>frac</tt></b> values (defined in <a
href="../src/gxfrac.h">src/gxfrac.h</a>) rather than floats.  The procedure
for this step is the virtual <b><tt>concretize_color</tt></b> and
<b><tt>concrete_space</tt></b> procedures in the (original) color space.
This step reduces Indexed colors, CIEBased colors, and Separation and
DeviceN colors that use the alternate space.

<li>The final step requires mapping a concrete color to the device's color
model, done by procedures in <a href="../src/gxcmap.c">src/gxcmap.c</a>.
These procedures combine the following three conceptual sub-steps:

<ul>

<li>A possible mapping between Device color spaces, possibly involving black
generation and undercolor removal.  The non-trivial cases are implemented in
<a href="../src/gxdcconv.c">src/gxdcconv.c</a>.

<li>Application of the transfer function(s) (done in-line).

<li>Halftoning if necessary: see below.

</ul>

The result is called (inappropriately) a <em>device color</em>
(<b><tt>gx_device_color</tt></b>, defined in <a
href="../src/gsdcolor.h">src/gsdcolor.h</a> and <a
href="../src/gxdcolor.h">src/gxdcolor.h</a>).  For ordinary non-Pattern
colors, a device color is either a pure color, or a halftone.  The device
and color model associated with a device color are implicit.  The procedure
for this step is the virtual <b><tt>remap_concrete_color</tt></b> procedure
in the color space.

<li>The pure colors that underlie a device color are opaque <em>pixel
values</em> defined by the device (misnamed <b><tt>gx_color_index</tt></b>,
defined in <a href="../src/gscindex.h">src/gscindex.h</a>).  The device with
which they are associated is implicit.  Although the format and
interpretation of a pixel value are known only to the device, the device's
color model and color representation capabilities are public, defined by a
<b><tt>gx_color_info</tt></b> structure stored in the device (defined in <a
href="../src/gxdevcli.h">src/gxdevcli.h</a>).  Virtual procedures of the
device driver map between pixel values and RGB or CMYK.  (This area is
untidy and will need to be cleaned up when we implement native
Separation/DeviceN colors.)

</ol>

<p>
Steps 2 and 3 are normally combined into a single step for efficiency, as
the <b><tt>remap_color</tt></b> virtual procedure in a color space.

<p>
Using a device color to actually paint pixels requires a further step called
<em>color loading</em>, implemented by the <b><tt>load</tt></b> virtual
procedure in the device color.  This does nothing for pure colors, but loads
the caches for halftones and Patterns.

<p>
All of the above steps -- concretizing, mapping to a device color, and color
loading -- are done as late as possible, normally not until the color is
actually needed for painting.

<p>
All painting operations (fill, stroke, imagemask/show) eventually call a
virtual procedure in the device color, either <b><tt>fill_rectangle</tt></b>
or <b><tt>fill_mask</tt></b> to actually paint pixels.  For rectangle fills,
pure colors call the device's <b><tt>fill_rectangle</tt></b> procedure;
halftones and tiled Patterns call the device's
<b><tt>tile_rectangle</tt></b>; shaded Patterns, and painting operations
that involve a RasterOp, do something more complicated.

<dl>

<dt>
Color specification:
<dd>
<a href="../src/gsccolor.h">src/gsccolor.h</a>,
<a href="../src/gscolor.c">src/gscolor.c</a>,
<a href="../src/gscolor.h">src/gscolor.h</a>,
<a href="../src/gscolor1.c">src/gscolor1.c</a>,
<a href="../src/gscolor1.h">src/gscolor1.h</a>,
<a href="../src/gscolor2.c">src/gscolor2.c</a>,
<a href="../src/gscolor2.h">src/gscolor2.h</a>,
<a href="../src/gscolor3.c">src/gscolor3.c</a>,
<a href="../src/gscolor3.h">src/gscolor3.h</a>,
<a href="../src/gshsb.c">src/gshsb.c</a>,
<a href="../src/gshsb.h">src/gshsb.h</a>,
<a href="../src/gxcolor2.h">src/gxcolor2.h</a>,
<a href="../src/gxcvalue.h">src/gxcvalue.h</a>.

<dt>
Color spaces:
<dd>
<a href="../src/gscdevn.c">src/gscdevn.c</a>,
<a href="../src/gscdevn.h">src/gscdevn.h</a>,
<a href="../src/gscie.c">src/gscie.c</a>,
<a href="../src/gscie.h">src/gscie.h</a>,
<a href="../src/gscpixel.c">src/gscpixel.c</a>,
<a href="../src/gscpixel.h">src/gscpixel.h</a>,
<a href="../src/gscscie.c">src/gscscie.c</a>,
<a href="../src/gscsepnm.h">src/gscsepnm.h</a>,
<a href="../src/gscsepr.c">src/gscsepr.c</a>,
<a href="../src/gscsepr.h">src/gscsepr.h</a>,
<a href="../src/gscspace.c">src/gscspace.c</a>,
<a href="../src/gscspace.h">src/gscspace.h</a>,
<a href="../src/gscssub.c">src/gscssub.c</a>,
<a href="../src/gscssub.h">src/gscssub.h</a>,
<a href="../src/gxcdevn.h">src/gxcdevn.h</a>,
<a href="../src/gxcie.h">src/gxcie.h</a>,
<a href="../src/gxcspace.h">src/gxcspace.h</a>.

<dt>
Color mapping:
<dd>
<a href="../src/gsciemap.c">src/gsciemap.c</a>,
<a href="../src/gscindex.h">src/gscindex.h</a>,
<a href="../src/gscrd.c">src/gscrd.c</a>,
<a href="../src/gscrd.h">src/gscrd.h</a>,
<a href="../src/gscrdp.c">src/gscrdp.c</a>,
<a href="../src/gscrdp.h">src/gscrdp.h</a>,
<a href="../src/gscsel.h">src/gscsel.h</a>,
<a href="../src/gsdcolor.h">src/gsdcolor.h</a>,
<a href="../src/gxcindex.h">src/gxcindex.h</a>,
<a href="../src/gxcmap.c">src/gxcmap.c</a>,
<a href="../src/gxcmap.h">src/gxcmap.h</a>,
<a href="../src/gxctable.c">src/gxctable.c</a>,
<a href="../src/gxctable.h">src/gxctable.h</a>,
<a href="../src/gxdcconv.c">src/gxdcconv.c</a>,
<a href="../src/gxdcconv.h">src/gxdcconv.h</a>,
<a href="../src/gxdcolor.c">src/gxdcolor.c</a>,
<a href="../src/gxdcolor.h">src/gxdcolor.h</a>,
<a href="../src/gxdevndi.c">src/gevndi.c</a>,
<a href="../src/gxdevndi.h">src/gxdevndi.h</a>,
<a href="../src/gxdither.h">src/gxdither.h</a>,
<a href="../src/gxfmap.h">src/gxfmap.h</a>,
<a href="../src/gxlum.h">src/gxlum.h</a>,
<a href="../src/gxtmap.h">src/gxtmap.h</a>.

<p>
ICC profiles are in some ways a special case of color mapping, but are
not standard in PostScript.

<dt>
Color mapping:
<dd>
<a href="../src/gsicc.c">src/gsicc.c</a>,
<a href="../src/gsicc.h">src/gsicc.h</a>,

</dl>

<p>
Ghostscript represents halftones internally by "whitening orders" --
essentially, arrays of arrays of bit coordinates within a halftone cell,
specifying which bits are inverted to get from halftone level K to level
K+1.  The code does support all of the PostScript halftone types, but they
are all ultimately reduced to whitening orders.

<p>
Threshold arrays, the more conventional representation of halftones, can be
mapped to whitening orders straightforwardly; however, whitening orders can
represent non-monotonic halftones (halftones where the bits turned on for
level K+1 don't necessarily include all the bits turned on for level K),
while threshold arrays cannot.  On the other hand, threshold arrays allow
rapid conversion of images (using a threshold comparison for each pixel)
with no additional space, while whitening orders do not: they require
storing the rendered halftone cell for each possible level as a bitmap.

<p>
Ghostscript uses two distinct types of rendered halftones -- that is, the
bitmap(s) that represent a particular level.

<ul>

<li>Binary halftones.  The rendered halftone is a single bit plane; each bit
selects one of two pure colors.  These are fast but limited: they are used
for monochrome output devices, or for color devices in those cases where
only two distinct colors are involved in a halftone (e.g., a pure cyan shade
on a CMYK device).  The device color for a binary halftone stores a pointer
to the halftone bitmap, and the two pure colors.

<li>Multi-plane halftones.  Internally, each plane is rendered individually.
Since there isn't enough room to store all 2^N pure colors, multi-plane
halftones only store the scaled values for the individual components; the
halftone renderer maps these to the pure colors on the fly, then combines
the planes to assemble an N-bit index into the list of colors for each
pixel, and stores the color into the fully rendered halftone.

</ul>

<p>
The halftone level for rendering a color is computed in <a
href="../src/gxdevndi.c">src/gxdevndi.c</a>; the actual halftone mask or
tile is computed either in <a href="../src/gxcht.c">src/gxcht.c</a> (for
multi-plane halftones), or in <a href="../src/gxht.c">src/gxht.c</a> and <a
href="../src/gxhtbit.c">src/gxhtbit.c</a> (for binary halftones).

<dl>

<dt>
Halftoning:
<dd>
<a href="../src/gsht.c">src/gsht.c</a>,
<a href="../src/gsht.h">src/gsht.h</a>,
<a href="../src/gsht1.c">src/gsht1.c</a>,
<a href="../src/gsht1.h">src/gsht1.h</a>,
<a href="../src/gshtscr.c">src/gshtscr.c</a>,
<a href="../src/gshtx.c">src/gshtx.c</a>,
<a href="../src/gshtx.h">src/gshtx.h</a>,
<a href="../src/gxcht.c">src/gxcht.c</a>,
<a href="../src/gxdht.h">src/gxdht.h</a>,
<a href="../src/gxdhtres.h">src/gxdhtres.h</a>,
<a href="../src/gxht.c">src/gxht.c</a>,
<a href="../src/gxht.h">src/gxht.h</a>,
<a href="../src/gxhtbit.c">src/gxhtbit.c</a>,
<a href="../src/gxhttile.h">src/gxhttile.h</a>,
<a href="../src/gxhttype.h">src/gxhttype.h</a>,
<a href="../src/gzht.h">src/gzht.h</a>.

<dt>
Well tempered screening:
<dd>
<a href="../src/gswts.h">src/gswts.h</a>,
<a href="../src/gswts.c">src/gswts.c</a>,
<a href="../src/gxwts.h">src/gxwts.h</a>,
<a href="../src/gxwts.c">src/gxwts.c</a>.

</dl>

<p>
Pattern colors (tiled patterns and shadings) each use a slightly different
approach from solid colors.

<p>
The device color for a tiled (PatternType 1) pattern contains a pointer to a
pattern instance, plus (for uncolored patterns) the device color to be
masked.  The pattern instance includes a procedure that actually paints the
pattern if the pattern is not in the cache.  For the PostScript interpreter,
this procedure returns an <b><tt>e_RemapColor</tt></b> exception code: this
eventually causes the interpreter to run the pattern's PaintProc, loading
the rendering into the cache, and then re-execute the original drawing
operator.

<dl>

<dt>
Patterns:
<dd>
<a href="../src/gspcolor.c">src/gspcolor.c</a>,
<a href="../src/gspcolor.h">src/gspcolor.h</a>,
<a href="../src/gsptype1.c">src/gsptype1.c</a>,
<a href="../src/gsptype1.h">src/gsptype1.h</a>,
<a href="../src/gxp1fill.c">src/gxp1fill.c</a>,
<a href="../src/gxp1impl.h">src/gxp1impl.h</a>,
<a href="../src/gxpcache.h">src/gxpcache.h</a>,
<a href="../src/gxpcmap.c">src/gxpcmap.c</a>,
<a href="../src/gxpcolor.h">src/gxpcolor.h</a>.

</dl>

<p>
The device color for a shading (PatternType 2) pattern also contains a
pointer to a pattern instance.  Shadings are not cached: painting with a
shading runs the shading algorithm every time.

<dl>

<dt>
Shading:
<dd>
<a href="../src/gsptype2.c">src/gsptype2.c</a>,
<a href="../src/gsptype2.h">src/gsptype2.h</a>,
<a href="../src/gsshade.c">src/gsshade.c</a>,
<a href="../src/gsshade.h">src/gsshade.h</a>,
<a href="../src/gxshade.c">src/gxshade.c</a>,
<a href="../src/gxshade.h">src/gxshade.h</a>,
<a href="../src/gxshade1.c">src/gxshade1.c</a>,
<a href="../src/gxshade4.c">src/gxshade4.c</a>,
<a href="../src/gxshade4.h">src/gxshade4.h</a>,
<a href="../src/gxshade6.c">src/gxshade6.c</a>.

</dl>

<p> In addition to the PostScript graphics model, Ghostscript supports RasterOp, 
  a weak form of alpha channel, and eventually the full PDF 1.4 transparency model. 
  The implemention of these facilities is quite slipshod and scattered: only RasterOp 
  is really implemented fully. There is a general compositing architecture, but 
  it is hardly used at all, and in particular is not used for RasterOp. It is 
  used for implementation of the general support for overprint and overprint mode.
<dl>

<dt>
Compositing architecture:
<dd>
<a href="../src/gscompt.h">src/gscompt.h</a>,
<a href="../src/gxcomp.h">src/gxcomp.h</a>.

<dt>
RasterOp:
<dd>
<a href="../src/gdevdrop.c">src/gdevdrop.c</a>,
<a href="../src/gdevrops.c">src/gdevrops.c</a>,
<a href="../src/gsnorop.c">src/gsnorop.c</a>,
<a href="../src/gsrop.c">src/gsrop.c</a>,
<a href="../src/gsrop.h">src/gsrop.h</a>,
<a href="../src/gsropc.c">src/gsropc.c</a>,
<a href="../src/gsropc.h">src/gsropc.h</a>,
<a href="../src/gsropt.h">src/gsropt.h</a>,
<a href="../src/gsroptab.c">src/gsroptab.c</a>,
<a href="../src/gxdevrop.h">src/gxdevrop.h</a>,
<a href="../src/gxropc.h">src/gxropc.h</a>.

<dt>
Alpha channel and compositing:
<dd>
<a href="../src/gsalpha.c">src/gsalpha.c</a>,
<a href="../src/gsalpha.h">src/gsalpha.h</a>,
<a href="../src/gsalphac.c">src/gsalphac.c</a>,
<a href="../src/gsalphac.h">src/gsalphac.h</a>,
<a href="../src/gsdpnext.h">src/gsdpnext.h</a>,
<a href="../src/gxalpha.h">src/gxalpha.h</a>.

<dt>
Advanced transparency:
<dd>
<a href="../src/gstparam.h">src/gstparam.h</a>,
<a href="../src/gstrans.c">src/gstrans.c</a>,
<a href="../src/gstrans.h">src/gstrans.h</a>,
<a href="../src/gxblend.c">src/gxblend.c</a>,
<a href="../src/gxblend.h">src/gxblend.h</a>,
<a href="../src/gdevp14.c">src/gdevp14.c</a>,
<a href="../src/gdevp14.h">src/gdevp14.h</a>,
<a href="../src/gdevpnga.c">src/gdevpnga.c</a>.

<dt>
Overprint and Overprint mode:
<dd>
<a href="../src/gsovrc.c">src/gsovrc.c</a>,
<a href="../src/gsovrc.h">src/gsovrc.h</a>,
<a href="../src/gxoprect.c">src/gxoprect.c</a>,
<a href="../src/gxoprect.h">src/gxoprect.h</a>.
There is support for both overprint and overprint mode. There is a general
compositor based implementation of these features for all devices. In addition,
the memory devices implement a higher speed set of special fill routines to
improve performance for printer based devices.

</dl>

<h4><a name="Clipping"></a>Clipping</h4>

<p>
The Ghostscript graphics library implements clipping by inserting a clipping
device in the device pipeline.  The clipping device modifies all drawing
operations to confine them to the clipping region.

<p>
The library supports three different kinds of clipping:

<dl>

<dt>
Region/path clipping
<dd>
This corresponds to the PostScript concept of a clipping path.  The clipping
region is specified either by a list of rectangles (subject to the
constraints documented in <a href="../src/gxcpath.h">src/gxcpath.h</a>), or
by a path that is converted to such a list of rectangles.

<dt>
Stationary mask clipping
<dd>
This corresponds to the mask operand of a PostScript ImageType 3 image.  The
clipping region is specified by a bitmap and an (X,Y) offset in the
coordinate space.

<dt>
Tiled mask clipping
<dd>
This corresponds to the region painted by a PostScript Pattern, for the case
where the Pattern does not completely cover its bounding box but the
combined transformation matrix has no skew or non-orthogonal rotation (i.e.,
XStep and YStep map respectively to (X,0) and (0,Y) or vice versa).  The
clipping region is specified by a bitmap and an (X,Y) offset in the
coordinate space, and is replicated indefinitely in both X and Y.

</dl>

<p>
Note that simply scan-converting a clipping path in the usual way does not
produce a succession of rectangles that can simply be stored as the list for
region-based clipping: in general, the rectangles do not satisfy the
constraint for rectangle lists specified in <a
href="../src/gxcpath.h">src/gxcpath.h</a>, since they may overlap in X, Y,
or both.  A non-trivial "clipping list accumulator" device is needed to
produce a rectangle list that does satisfy the constraint.

<dl>

<dt>
Clipping support:
<dd>
<a href="../src/gxclip.c">src/gxclip.c</a>,
<a href="../src/gxclip.h">src/gxclip.h</a>.

<dt>
Region/path clipping:
<dd>
<a href="../src/gxcpath.c">src/gxcpath.c</a>,
<a href="../src/gxcpath.h">src/gxcpath.h</a>,
<a href="../src/gzcpath.h">src/gzcpath.h</a>.

<dt>
Clipping list accumulator:
<dd>
<a href="../src/gxacpath.c">src/gxacpath.c</a>,
<a href="../src/gzacpath.h">src/gzacpath.h</a>.

<dt>
Mask clipping support:
<dd>
<a href="../src/gxmclip.c">src/gxmclip.c</a>,
<a href="../src/gxmclip.h">src/gxmclip.h</a>.

<dt>
Stationary mask clipping:
<dd>
<a href="../src/gxclipm.c">src/gxclipm.c</a>,
<a href="../src/gxclipm.h">src/gxclipm.h</a>.

<dt>
Tiled mask clipping:
<dd>
<a href="../src/gxclip2.c">src/gxclip2.c</a>,
<a href="../src/gxclip2.h">src/gxclip2.h</a>.

</dl>

<h4><a name="Other_graphics"></a>Other graphics</h4>

<dl>

<dt>
Miscellaneous graphics state:
<dd>
<a href="../src/gsclipsr.c">src/gsclipsr.c</a>,
<a href="../src/gsclipsr.h">src/gsclipsr.h</a>,
<a href="../src/gsdps.c">src/gsdps.c</a>,
<a href="../src/gsdps.h">src/gsdps.h</a>,
<a href="../src/gsdps1.c">src/gsdps1.c</a>,
<a href="../src/gsistate.c">src/gsistate.c</a>,
<a href="../src/gsline.c">src/gsline.c</a>,
<a href="../src/gsline.h">src/gsline.h</a>,
<a href="../src/gslparam.h">src/gslparam.h</a>,
<a href="../src/gsstate.c">src/gsstate.c</a>,
<a href="../src/gsstate.h">src/gsstate.h</a>,
<a href="../src/gstrap.c">src/gstrap.c</a>,
<a href="../src/gstrap.h">src/gstrap.h</a>,
<a href="../src/gxclipsr.h">src/gxclipsr.h</a>,
<a href="../src/gxistate.h">src/gxistate.h</a>,
<a href="../src/gxline.h">src/gxline.h</a>,
<a href="../src/gxstate.h">src/gxstate.h</a>,
<a href="../src/gzline.h">src/gzline.h</a>,
<a href="../src/gzstate.h">src/gzstate.h</a>.

</dl>

<h4><a name="FAPI_support_gx"></a>Font API support</h4>

<dl>

<dt>
UFST bridge:
<dd>
<a href="../src/gxfapi.c">src/gxfapi.c</a>,
<a href="../src/gxfapi.h">src/gxfapi.h</a>.
</dl>


<h4><a name="Driver_support"></a>Driver support</h4>

<dl>

<dt>
Generic driver support:
<dd>
<a href="../src/gdevdcrd.c">src/gdevdcrd.c</a>,
<a href="../src/gdevdcrd.h">src/gdevdcrd.h</a>,
<a href="../src/gdevemap.c">src/gdevemap.c</a>,
<a href="../src/gsdevice.c">src/gsdevice.c</a>,
<a href="../src/gsdevice.h">src/gsdevice.h</a>,
<a href="../src/gsdparam.c">src/gsdparam.c</a>,
<a href="../src/gsxfont.h">src/gsxfont.h</a>,
<a href="../src/gxdevbuf.h">src/gxdevbuf.h</a>,
<a href="../src/gxdevcli.h">src/gxdevcli.h</a>,
<a href="../src/gxdevice.h">src/gxdevice.h</a>,
<a href="../src/gxrplane.h">src/gxrplane.h</a>,
<a href="../src/gxxfont.h">src/gxxfont.h</a>.

<dt>
Accessing rendered bits:
<dd>
<a href="../src/gdevdbit.c">src/gdevdbit.c</a>,
<a href="../src/gdevdgbr.c">src/gdevdgbr.c</a>,
<a href="../src/gxbitfmt.h">src/gxbitfmt.h</a>,
<a href="../src/gxgetbit.h">src/gxgetbit.h</a>.

<dt>
"Printer" driver support:
<dd>
<a href="../src/gdevmeds.c">src/gdevmeds.c</a>,
<a href="../src/gdevmeds.h">src/gdevmeds.h</a>,
<a href="../src/gdevppla.c">src/gdevppla.c</a>,
<a href="../src/gdevppla.h">src/gdevppla.h</a>,
<a href="../src/gdevprn.c">src/gdevprn.c</a>,
<a href="../src/gdevprn.h">src/gdevprn.h</a>,
<a href="../src/gdevprna.c">src/gdevprna.c</a>,
<a href="../src/gdevprna.h">src/gdevprna.h</a>,
<a href="../src/gxband.h">src/gxband.h</a>,
<a href="../src/gxpageq.c">src/gxpageq.c</a>,
<a href="../src/gxpageq.h">src/gxpageq.h</a>.

<dt>
High-level device support:
<dd>
<a href="../src/gdevvec.c">src/gdevvec.c</a>,
<a href="../src/gdevvec.h">src/gdevvec.h</a>,
<a href="../src/gxhldevc.c">src/gxhldevc.c</a>,
<a href="../src/gxhldevc.h">src/gxhldevc.h</a>.

<dt>
Banding:
<dd>
<a href="../src/gxclbits.c">src/gxclbits.c</a>,
<a href="../src/gxcldev.h">src/gxcldev.h</a>,
<a href="../src/gxclfile.c">src/gxclfile.c</a>,
<a href="../src/gxclimag.c">src/gxclimag.c</a>,
<a href="../src/gxclio.h">src/gxclio.h</a>,
<a href="../src/gxclist.c">src/gxclist.c</a>,
<a href="../src/gxclist.h">src/gxclist.h</a>,
<a href="../src/gxcllzw.c">src/gxcllzw.c</a>,
<a href="../src/gxclmem.c">src/gxclmem.c</a>,
<a href="../src/gxclmem.h">src/gxclmem.h</a>,
<a href="../src/gxclpage.c">src/gxclpage.c</a>,
<a href="../src/gxclpage.h">src/gxclpage.h</a>,
<a href="../src/gxclpath.c">src/gxclpath.c</a>,
<a href="../src/gxclpath.h">src/gxclpath.h</a>,
<a href="../src/gxclrast.c">src/gxclrast.c</a>,
<a href="../src/gxclread.c">src/gxclread.c</a>,
<a href="../src/gxclrect.c">src/gxclrect.c</a>,
<a href="../src/gxclutil.c">src/gxclutil.c</a>,
<a href="../src/gxclzlib.c">src/gxclzlib.c</a>,
<a href="../src/gxdhtserial.c">src/gxdhtserial.c</a>,
<a href="../src/gxdhtserial.h">src/gxdhtserial.h</a>,
<a href="../src/gsserial.c">src/gsserial.c</a>,
<a href="../src/gsserial.h">src/gsserial.h</a>.

</dl>

<h4><a name="Visual_trace"></a>Visual Trace</h4>

<dl>

<dt>
Visual Trace support :
<dd>
<a href="../src/vdtrace.h">src/vdtrace.h</a>,
<a href="../src/vdtrace.c">src/vdtrace.c</a>.
</dl>

See <a href="Lib.htm">doc/Lib.htm</a> for extensive documentation on
Visual Trace instructions.


<h3><a name="Device_drivers"></a>Device drivers</h3>

<p>
See <a href="Drivers.htm">doc/Drivers.htm</a> for extensive documentation on
the interface between the core code and drivers.

<p>
The driver API includes high-level (path / image / text), mid-level
(polygon), and low-level (rectangle / raster) operations.  Most devices
implement only the low-level operations, and let generic code break down the
high-level operations.  However, some devices produce high-level output, and
therefore must implement the high-level operations.

<h4><a name="Internal_devices"></a>Internal devices</h4>

<p>
There are a number of "devices" that serve internal purposes.  Some of these
are meant to be real rendering targets; others are intended for use in
device pipelines.  The rendering targets are:

<dl>

<dt>
Memory devices, depth-independent:
<dd>
<a href="../src/gdevmem.c">src/gdevmem.c</a>,
<a href="../src/gdevmem.h">src/gdevmem.h</a>,
<a href="../src/gdevmpla.c">src/gdevmpla.c</a>,
<a href="../src/gdevmpla.h">src/gdevmpla.h</a>,
<a href="../src/gdevmrop.h">src/gdevmrop.h</a>,
<a href="../src/gsdevmem.c">src/gsdevmem.c</a>,
<a href="../src/gxdevmem.h">src/gxdevmem.h</a>.

<dt>
Memory devices, specific depths:
<dd>
<a href="../src/gdevm1.c">src/gdevm1.c</a>,
<a href="../src/gdevm2.c">src/gdevm2.c</a>,
<a href="../src/gdevm4.c">src/gdevm4.c</a>,
<a href="../src/gdevm8.c">src/gdevm8.c</a>,
<a href="../src/gdevm16.c">src/gdevm16.c</a>,
<a href="../src/gdevm24.c">src/gdevm24.c</a>,
<a href="../src/gdevm32.c">src/gdevm32.c</a>,
<a href="../src/gdevm40.c">src/gdevm40.c</a>,
<a href="../src/gdevm48.c">src/gdevm48.c</a>,
<a href="../src/gdevm56.c">src/gdevm56.c</a>,
<a href="../src/gdevm64.c">src/gdevm64.c</a>,
<a href="../src/gdevmr1.c">src/gdevmr1.c</a>,
<a href="../src/gdevmr2n.c">src/gdevmr2n.c</a>,
<a href="../src/gdevmr8n.c">src/gdevmr8n.c</a>.

<dt>
Alpha-related devices:
<dd>
<a href="../src/gdevabuf.c">src/gdevabuf.c</a>.

<dt>
Other devices:
<dd>
<a href="../src/gdevdflt.c">src/gdevdflt.c</a>,
<a href="../src/gdevhit.c">src/gdevhit.c</a>,
<a href="../src/gdevmrun.c">src/gdevmrun.c</a>,
<a href="../src/gdevmrun.h">src/gdevmrun.h</a>,
<a href="../src/gdevplnx.c">src/gdevplnx.c</a>,
<a href="../src/gdevplnx.h">src/gdevplnx.h</a>.
</dl>

<p>
The forwarding devices meant for use in pipelines are:

<dl>

<dt>
The bounding box device:
<dd>
<a href="../src/gdevbbox.h">src/gdevbbox.h</a>,
<a href="../src/gdevbbox.c">src/gdevbbox.c</a>.

<dt>
Clipping devices:
<dd>
See under <a href="#Clipping">Clipping</a> above.

<dt>
Device filter stack:
<dd>
<a href="../src/gsdfilt.c">src/gsdfilt.c</a>,
<a href="../src/gsdfilt.h">src/gsdfilt.h</a>.

<dt>
Other devices:
<dd>
<a href="../src/gdevcmap.c">src/gdevcmap.c</a>,
<a href="../src/gdevcmap.h">src/gdevcmap.h</a>,
<a href="../src/gdevnfwd.c">src/gdevnfwd.c</a>.

</dl>

<h4><a name="PS_and_PDF_writers"></a>PostScript and PDF writers</h4>

<p>
Because PostScript and PDF have the same graphics model, lexical syntax, and
stack-based execution model, the drivers that produce PostScript and PDF
output share a significant amount of support code.  In the future, the
PostScript output driver should be replaced with a slightly modified version
of the PDF driver, since the latter is far more sophisticated (in
particular, it has extensive facilities for image compression and for
handling text and fonts).

<p>
The PDF code for handling text and fonts is complex and fragile.  A major
rewrite in June 2002 was intended to make it more robust and somewhat easier
to understand, but also increased its size by about 40%, contrary to the
expectation that it would shrink.  Currently both sets of code are in the
code base, with compatible APIs, selected by a line in <a
href="../src/devs.mak">src/devs.mak</a>.

<dl>

<dt>
Shared support:
<dd>

<dl>
Writing fonts:
<dd>
<a href="../src/gdevpsf.h">src/gdevpsf.h</a>,
<a href="../src/gdevpsf1.c">src/gdevpsf1.c</a>,
<a href="../src/gdevpsf2.c">src/gdevpsf2.c</a>,
<a href="../src/gdevpsfm.c">src/gdevpsfm.c</a>,
<a href="../src/gdevpsft.c">src/gdevpsft.c</a>,
<a href="../src/gdevpsfu.c">src/gdevpsfu.c</a>,
<a href="../src/gdevpsfx.c">src/gdevpsfx.c</a>,
<a href="../src/gscedata.c">src/gscedata.c</a>,
<a href="../src/gscedata.h">src/gscedata.h</a>,
<a href="../src/gscencs.c">src/gscencs.c</a>,
<a href="../src/gscencs.h">src/gscencs.h</a>.

<dt>
Other:
<dd>
<a href="../src/gdevpsdf.h">src/gdevpsdf.h</a>,
<a href="../src/gdevpsdi.c">src/gdevpsdi.c</a>,
<a href="../src/gdevpsdp.c">src/gdevpsdp.c</a>,
<a href="../src/gdevpsds.c">src/gdevpsds.c</a>,
<a href="../src/gdevpsds.h">src/gdevpsds.h</a>,
<a href="../src/gdevpsdu.c">src/gdevpsdu.c</a>.

</dl>

<dt>
PostScript output driver ([e]pswrite):
<dd>
<a href="../src/gdevps.c">src/gdevps.c</a>,
<a href="../src/gdevpsu.c">src/gdevpsu.c</a>,
<a href="../src/gdevpsu.h">src/gdevpsu.h</a>.

<dt>
PDF output driver (pdfwrite):
<dd>
<dl>

<dt>
Substrate:
<dd>
<a href="../src/gdevpdfo.c">src/gdevpdfo.c</a>,
<a href="../src/gdevpdfo.h">src/gdevpdfo.h</a>,
<a href="../src/gdevpdfr.c">src/gdevpdfr.c</a>,
<a href="../src/gdevpdfu.c">src/gdevpdfu.c</a>.

<dt>
Old text and fonts:
<dd>
<a href="../src/gdevpdfe.c">src/gdevpdfe.c</a>,
<a href="../src/gdevpdff.c">src/gdevpdff.c</a>,
<a href="../src/gdevpdff.h">src/gdevpdff.h</a>,
<a href="../src/gdevpdfs.c">src/gdevpdfs.c</a>,
<a href="../src/gdevpdft.c">src/gdevpdft.c</a>,
<a href="../src/gdevpdft.h">src/gdevpdft.h</a>,
<a href="../src/gdevpdfw.c">src/gdevpdfw.c</a>.

<dt>
New text and fonts:
<dd>
<a href="../src/gdevpdt.c">src/gdevpdt.c</a>,
<a href="../src/gdevpdt.h">src/gdevpdt.h</a>,
<a href="../src/gdevpdtb.c">src/gdevpdtb.c</a>,
<a href="../src/gdevpdtb.h">src/gdevpdtb.h</a>,
<a href="../src/gdevpdtc.c">src/gdevpdtc.c</a>,
<a href="../src/gdevpdtd.c">src/gdevpdtd.c</a>,
<a href="../src/gdevpdtd.h">src/gdevpdtd.h</a>,
<a href="../src/gdevpdte.c">src/gdevpdte.c</a>,
<a href="../src/gdevpdtf.c">src/gdevpdtf.c</a>,
<a href="../src/gdevpdtf.h">src/gdevpdtf.h</a>,
<a href="../src/gdevpdti.c">src/gdevpdti.c</a>,
<a href="../src/gdevpdti.h">src/gdevpdti.h</a>,
<a href="../src/gdevpdts.c">src/gdevpdts.c</a>,
<a href="../src/gdevpdts.h">src/gdevpdts.h</a>,
<a href="../src/gdevpdtt.c">src/gdevpdtt.c</a>,
<a href="../src/gdevpdtt.h">src/gdevpdtt.h</a>,
<a href="../src/gdevpdtv.c">src/gdevpdtv.c</a>,
<a href="../src/gdevpdtv.h">src/gdevpdtv.h</a>,
<a href="../src/gdevpdtw.c">src/gdevpdtw.c</a>,
<a href="../src/gdevpdtw.h">src/gdevpdtw.h</a>,
<a href="../src/gdevpdtx.h">src/gdevpdtx.h</a>.

<dt>
Graphics:
<dd>
<a href="../src/gdevpdfc.c">src/gdevpdfc.c</a>,
<a href="../src/gdevpdfc.h">src/gdevpdfc.h</a>,
<a href="../src/gdevpdfd.c">src/gdevpdfd.c</a>,
<a href="../src/gdevpdfg.c">src/gdevpdfg.c</a>,
<a href="../src/gdevpdfg.h">src/gdevpdfg.h</a>,
<a href="../src/gdevpdfk.c">src/gdevpdfk.c</a>,
<a href="../src/gdevpdfv.c">src/gdevpdfv.c</a>.

<dt>
Images:
<dd>
<a href="../src/gdevpdfb.c">src/gdevpdfb.c</a>,
<a href="../src/gdevpdfi.c">src/gdevpdfi.c</a>,
<a href="../src/gdevpdfj.c">src/gdevpdfj.c</a>.

<dt>
Other:
<dd>
<a href="../src/gdevpdf.c">src/gdevpdf.c</a>,
<a href="../src/gdevpdfm.c">src/gdevpdfm.c</a>,
<a href="../src/gdevpdfp.c">src/gdevpdfp.c</a>,
<a href="../src/gdevpdfx.h">src/gdevpdfx.h</a>.

</dl>

</dl>

<h4><a name="High_level_devices"></a>Other high-level devices</h4>

<p>
Currently, the CGM driver is raster-only.  If anyone cares seriously about
CGM in the future, this driver should be upgraded to a higher level.

<dl>

<dt>
PCL XL output device (pxlmono, pxlcolor):
<dd>
<a href="../src/gdevpx.c">src/gdevpx.c</a>,
<a href="../src/gdevpxat.h">src/gdevpxat.h</a>,
<a href="../src/gdevpxen.h">src/gdevpxen.h</a>,
<a href="../src/gdevpxop.h">src/gdevpxop.h</a>,
<a href="../src/gdevpxut.c">src/gdevpxut.c</a>,
<a href="../src/gdevpxut.h">src/gdevpxut.h</a>.

<dt>
Other high-level devices:
<dd>
<a href="../src/gdevtrac.c">src/gdevtrac.c</a>.

</dl>

<h4><a name="Other_maintained_drivers"></a>Other maintained drivers</h4>

<p>
The standard Ghostscript distribution includes a collection of drivers,
mostly written by Aladdin Enterprises, that are "maintained" in the same
sense as the Ghostscript core code.

<dl>

<dt>
Display drivers:
<dd>
<a href="../src/gdev8bcm.c">src/gdev8bcm.c</a>,
<a href="../src/gdev8bcm.h">src/gdev8bcm.h</a>,
<a href="../src/gdevegaa.asm">src/gdevegaa.asm</a>,
<a href="../src/gdevevga.c">src/gdevevga.c</a>,
<a href="../src/gdevl256.c">src/gdevl256.c</a>,
<a href="../src/gdevpccm.c">src/gdevpccm.c</a>,
<a href="../src/gdevpccm.h">src/gdevpccm.h</a>,
<a href="../src/gdevpcfb.c">src/gdevpcfb.c</a>,
<a href="../src/gdevpcfb.h">src/gdevpcfb.h</a>,
<a href="../src/gdevs3ga.c">src/gdevs3ga.c</a>,
<a href="../src/gdevsco.c">src/gdevsco.c</a>,
<a href="../src/gdevsvga.c">src/gdevsvga.c</a>,
<a href="../src/gdevsvga.h">src/gdevsvga.h</a>,
<a href="../src/gdevvglb.c">src/gdevvglb.c</a>.

<dt>
Window system drivers:
<dd>

<dl>

<dt>
X Windows:
<dd>
<a href="../src/gdevx.c">src/gdevx.c</a>,
<a href="../src/gdevx.h">src/gdevx.h</a>,
<a href="../src/gdevxalt.c">src/gdevxalt.c</a>,
<a href="../src/gdevxcmp.c">src/gdevxcmp.c</a>,
<a href="../src/gdevxcmp.h">src/gdevxcmp.h</a>,
<a href="../src/gdevxini.c">src/gdevxini.c</a>,
<a href="../src/gdevxres.c">src/gdevxres.c</a>,
<a href="../src/gdevxxf.c">src/gdevxxf.c</a>.

<dt>
Microsoft Windows:
<dd>
<a href="../src/gdevmswn.c">src/gdevmswn.c</a>,
<a href="../src/gdevmswn.h">src/gdevmswn.h</a>,
<a href="../src/gdevmsxf.c">src/gdevmsxf.c</a>,
<a href="../src/gdevwddb.c">src/gdevwddb.c</a>,
<a href="../src/gdevwdib.c">src/gdevwdib.c</a>.

<dt>
OS/2 Presentation Manager:
<dd>
<a href="../src/gdevpm.c">src/gdevpm.c</a>,
<a href="../src/gdevpm.h">src/gdevpm.h</a>,
<a href="../src/gspmdrv.c">src/gspmdrv.c</a>,
<a href="../src/gspmdrv.h">src/gspmdrv.h</a>.

</dl>

<dt>
Raster file output drivers:
<dd>

<dl>

<dt>
Fax and TIFF:
<dd>
<a href="../src/gdevfax.c">src/gdevfax.c</a>,
<a href="../src/gdevfax.h">src/gdevfax.h</a>,
<a href="../src/gdevtfax.c">src/gdevtfax.c</a>,
<a href="../src/gdevtfax.h">src/gdevtfax.h</a>,
<a href="../src/gdevtifs.c">src/gdevtifs.c</a>,
<a href="../src/gdevtifs.h">src/gdevtifs.h</a>,
<a href="../src/gdevtfnx.c">src/gdevtfnx.c</a>.

<dt>
(Low-level) CGM:
<dd>
<a href="../src/gdevcgm.c">src/gdevcgm.c</a>,
<a href="../src/gdevcgml.c">src/gdevcgml.c</a>,
<a href="../src/gdevcgml.h">src/gdevcgml.h</a>,
<a href="../src/gdevcgmx.h">src/gdevcgmx.h</a>.

<dt>
Example DeviceN devices:
<dd>
<a href="../src/gdevdevn.c">src/gdevdevn.c</a>,
<a href="../src/gdevdevn.h">src/gdevdevn.h</a>,
<a href="../src/gdevxcf.c">src/gdevxcf.c</a>,
<a href="../src/gdevpsd.c">src/gdevpsd.c</a>,
<a href="../src/gdevperm.c">src/gdevperm.c</a>.

<dt>
Other raster file formats:
<dd>
<a href="../src/gdevbit.c">src/gdevbit.c</a>,
<a href="../src/gdevbmp.c">src/gdevbmp.c</a>,
<a href="../src/gdevbmp.h">src/gdevbmp.h</a>,
<a href="../src/gdevbmpa.c">src/gdevbmpa.c</a>,
<a href="../src/gdevbmpc.c">src/gdevbmpc.c</a>,
<a href="../src/gdevjpeg.c">src/gdevjpeg.c</a>,
<a href="../src/gdevmiff.c">src/gdevmiff.c</a>,
<a href="../src/gdevp2up.c">src/gdevp2up.c</a>,
<a href="../src/gdevpcx.c">src/gdevpcx.c</a>,
<a href="../src/gdevpbm.c">src/gdevpbm.c</a>,
<a href="../src/gdevpng.c">src/gdevpng.c</a>,
<a href="../src/gdevpsim.c">src/gdevpsim.c</a>.

</dl>

<dt>
Printer drivers:
<dd>

<dl>

<dt>
Operating system printer services:
<dd>
<a href="../src/gdevos2p.c">src/gdevos2p.c</a>,
<a href="../src/gdevwpr2.c">src/gdevwpr2.c</a>,
<a href="../src/gdevwprn.c">src/gdevwprn.c</a>.

<dt>
H-P monochrome printers:
<dd>
<a href="../src/gdevdljm.c">src/gdevdljm.c</a>,
<a href="../src/gdevdljm.h">src/gdevdljm.h</a>,
<a href="../src/gdevdjet.c">src/gdevdjet.c</a>,
<a href="../src/gdevlj56.c">src/gdevlj56.c</a>.

<dt>
Other printers:
<dd>
<a href="../src/gdevatx.c">src/gdevatx.c</a>.

</dl>

</dl>

<h4><a name="Contributed_drivers"></a>Contributed drivers</h4>

<p>
This list is likely to be incomplete and inaccurate: see <a
href="../src/contrib.mak">src/contrib.mak</a> for the real one.

<dl>

<dt>
Display and window system drivers:
<dd>
<a href="../src/gdev3b1.c">src/gdev3b1.c</a>,
<a href="../src/gdevherc.c">src/gdevherc.c</a>,
<a href="../src/gdevpe.c">src/gdevpe.c</a>,
<a href="../src/gdevsnfb.c">src/gdevsnfb.c</a>,
<a href="../src/gdevsun.c">src/gdevsun.c</a>.

<dt>
Raster file output drivers:
<dd>
<a href="../src/gdevcfax.c">src/gdevcfax.c</a>,
<a href="../src/gdevcif.c">src/gdevcif.c</a>,
<a href="../src/gdevdfax.c">src/gdevdfax.c</a>,
<a href="../src/gdevifno.c">src/gdevifno.c</a>,
<a href="../src/gdevmgr.c">src/gdevmgr.c</a>,
<a href="../src/gdevmgr.h">src/gdevmgr.h</a>,
<a href="../src/gdevsgi.c">src/gdevsgi.c</a>,
<a href="../src/gdevsgi.h">src/gdevsgi.h</a>,
<a href="../src/gdevsunr.c">src/gdevsunr.c</a>.

<dt>
Printer drivers:
<dd>
<a href="../lib/bj8.rpd">lib/bj8.rpd</a>,
<a href="../lib/cbjc600.ppd">lib/cbjc600.ppd</a>,
<a href="../lib/cbjc800.ppd">lib/cbjc800.ppd</a>,
<a href="../src/gdev3852.c">src/gdev3852.c</a>,
<a href="../src/gdev4081.c">src/gdev4081.c</a>,
<a href="../src/gdev4693.c">src/gdev4693.c</a>,
<a href="../src/gdev8510.c">src/gdev8510.c</a>,
<a href="../src/gdevadmp.c">src/gdevadmp.c</a>,
<a href="../src/gdevbj10.c">src/gdevbj10.c</a>,
<a href="../src/gdevbjc.h">src/gdevbjc.h</a>,
<a href="../src/gdevbjcl.c">src/gdevbjcl.c</a>,
<a href="../src/gdevbjcl.h">src/gdevbjcl.h</a>,
<a href="../src/gdevccr.c">src/gdevccr.c</a>,
<a href="../src/gdevcdj.c">src/gdevcdj.c</a>,
<a href="../src/gdevclj.c">src/gdevclj.c</a>,
<a href="../src/gdevcljc.c">src/gdevcljc.c</a>,
<a href="../src/gdevcp50.c">src/gdevcp50.c</a>,
<a href="../src/gdevcslw.c">src/gdevcslw.c</a>,
<a href="../src/gdevdjtc.c">src/gdevdjtc.c</a>,
<a href="../src/gdevdm24.c">src/gdevdm24.c</a>,
<a href="../src/gdevepsc.c">src/gdevepsc.c</a>,
<a href="../src/gdevepsn.c">src/gdevepsn.c</a>,
<a href="../src/gdevescp.c">src/gdevescp.c</a>,
<a href="../src/gdevhl7x.c">src/gdevhl7x.c</a>,
<a href="../src/gdevijs.c">src/gdevijs.c</a>,
<a href="../src/gdevimgn.c">src/gdevimgn.c</a>,
<a href="../src/gdevl31s.c">src/gdevl31s.c</a>,
<a href="../src/gdevlbp8.c">src/gdevlbp8.c</a>,
<a href="../src/gdevlp8k.c">src/gdevlp8k.c</a>,
<a href="../src/gdevlxm.c">src/gdevlxm.c</a>,
<a href="../src/gdevn533.c">src/gdevn533.c</a>,
<a href="../src/gdevo182.c">src/gdevo182.c</a>,
<a href="../src/gdevokii.c">src/gdevokii.c</a>,
<a href="../src/gdevpcl.c">src/gdevpcl.c</a>,
<a href="../src/gdevpcl.h">src/gdevpcl.h</a>,
<a href="../src/gdevphex.c">src/gdevphex.c</a>,
<a href="../src/gdevpjet.c">src/gdevpjet.c</a>,
<a href="../src/gdevsj48.c">src/gdevsj48.c</a>,
<a href="../src/gdevsppr.c">src/gdevsppr.c</a>,
<a href="../src/gdevstc.c">src/gdevstc.c</a>,
<a href="../src/gdevstc.h">src/gdevstc.h</a>,
<a href="../src/gdevstc1.c">src/gdevstc1.c</a>,
<a href="../src/gdevstc2.c">src/gdevstc2.c</a>,
<a href="../src/gdevstc3.c">src/gdevstc3.c</a>,
<a href="../src/gdevstc4.c">src/gdevstc4.c</a>,
<a href="../src/gdevtknk.c">src/gdevtknk.c</a>,
<a href="../src/gdevupd.c">src/gdevupd.c</a>.

</dl>

<h3><a name="PostScript_interpreter"></a>PostScript interpreter</h3>

<p>
The PostScript interpreter is conceptually simple: in fact, an interpreter
that could execute "3 4 add =" and print "7" was running 3 weeks after the
first line of Ghostscript code was written.  However, a number of
considerations make the code large and complex.

<p>
The interpreter is designed to run in environments with very limited memory.
The main consequence of this is that it cannot allocate its stacks
(dictionary, execution, operand) as ordinary arrays, since the
user-specified stack size limit may be very large.  Instead, it allocates
them as a linked list of blocks.  See below for more details.

<p>
The interpreter must never cause a C runtime error that it cannot trap.
Unfortunately, C implementations almost never provide the ability to trap
stack overflow.  In order to put a fixed bound on the C stack size, the
interpreter never implements PostScript recursion by C recursion.  This
means that any C code that logically needs to call the interpreter must
instead push a continuation (including all necessary state information) on
the PostScript execution stack, followed by the PostScript object to be
executed, and then <em>return</em> to the interpreter.  (See <a
href="../src/estack.h">src/estack.h</a> for more details about
continuations.)  Unfortunately, since PostScript Level 2 introduces streams
whose data source can be a PostScript procedure, any code that reads or
writes stream data must be prepared to suspend itself, storing all necessary
state in a continuation.  There are some places where this is extremely
awkward, such as the scanner/parser.

<p>
The use of continuations affects many places in the interpreter, and even
some places in the graphics library.  For example, when processing an image,
one may need to call a PostScript procedure as part of mapping a CIE color
to a device color.  Ghostscript uses a variety of dodges to handle this: for
example, in the case of CIE color mapping, all of the PostScript procedures
are pre-sampled and the results cached.  The Adobe implementation limits
this kind of recursion to a fixed number of levels (5?): this would be
another acceptable approach, but at this point it would require far more
code restructuring than it would be worth.

<p>
A significant amount of the PostScript language implementation is in fact
written in PostScript.  Writing in PostScript leverages the C code for
multi-threading, garbage collection, error handling, continuations for
streams, etc., etc.; also, we have found PostScript in general more concise
and easier to debug than C, mostly because of memory management issues.  So
given the choice, we tended to implement a feature in PostScript if it
worked primarily with PostScript data structures, wasn't heavily used
(example: font loading), or if it interacted with the stream or other
callback machinery (examples: ReusableFileDecode streams, resourceforall).
Often we would add non-standard PostScript operators for functions that had
to run faster or that did more C-like things, such as the media matching
algorithm for setpagedevice.



<h4><a name="Main_program"></a>Main program</h4>

<p>
The main program of the interpreter is normally invoked from the command
line, but it has an API as well.  In fact, it has two APIs: one that
recognizes the existence of multiple "interpreter instances" (although it
currently provides a default instance, which almost all clients use), and a
completely different one designed for Windows DLLs.  These should be unified
as soon as possible, since there are two steadily growing incompatible
bodies of client code.

<dl>

<dt>
Files:
<dd>
<a href="../src/gs.c">src/gs.c</a>,
<a href="../src/gserver.c">src/gserver.c</a>,
<a href="../src/iccinit0.c">src/iccinit0.c</a>,
<a href="../src/iinit.c">src/iinit.c</a>,
<a href="../src/iinit.h">src/iinit.h</a>,
<a href="../src/imain.c">src/imain.c</a>,
<a href="../src/imain.h">src/imain.h</a>,
<a href="../src/imainarg.c">src/imainarg.c</a>,
<a href="../src/imainarg.h">src/imainarg.h</a>,
<a href="../src/iminst.h">src/iminst.h</a>,
<a href="../src/main.h">src/main.h</a>.

</dl>

<h4><a name="Data_structures"></a>Data structures</h4>

<p>
The main data structures visible to the PostScript programmers are arrays,
contexts, dictionaries, names, and stacks.

<p>
Arrays have no unusual properties.  See under <a href="#Refs">Refs</a> below
for more information about how array elements are stored.

<p>
Contexts are used to hold the interpreter state even in configurations that
don't include the Display PostScript multiple context extension.  Context
switching is implemented by a complex cooperation of C and PostScript code.

<p>
Dictionaries have two special properties worth noting:

<ul>

<li>They use an optimized storage representation if all the keys are names,
which is almost always the case.

<li>They interact with a caching scheme used to accelerate name lookup in
the interpreter.

</ul>

<p>
Names are allocated in blocks.  The characters and hash chains are stored
separately from the lookup cache information, so that in the future, most of
the former can be compiled into the executable and shared or put in ROM.
(This is not actually done yet.)

<dl>

<dt>
Contexts:
<dd>
<a href="../src/icontext.c">src/icontext.c</a>,
<a href="../src/icontext.h">src/icontext.h</a>,
<a href="../src/icstate.h">src/icstate.h</a>.

<dt>
Dictionaries:
<dd>
<a href="../src/iddict.h">src/iddict.h</a>,
<a href="../src/idict.h">src/idict.h</a>,
<a href="../src/idict.c">src/idict.c</a>,
<a href="../src/idictdef.h">src/idictdef.h</a>.

<dt>
Names:
<dd>
<a href="../src/iname.c">src/iname.c</a>,
<a href="../src/iname.h">src/iname.h</a>,
<a href="../src/inamedef.h">src/inamedef.h</a>,
<a href="../src/inameidx.h">src/inameidx.h</a>,
<a href="../src/inames.h">src/inames.h</a>,
<a href="../src/inamestr.h">src/inamestr.h</a>.

</dl>

<h4><a name="Stacks"></a>Stacks</h4>

<p>
As mentioned above, each stack is allocated as a linked list of blocks.
However, for reasonable performance, operators must normally be able to
access their operands and produce their results using indexing rather than
an access procedure.  This is implemented by ensuring that all the operands
of an operator are in the topmost block of the stack, using guard entries
that cause an internal error if the condition isn't met.  See <a
href="../src/iostack.h">src/iostack.h</a> for more details.

<dl>

<dt>
Generic stacks:
<dd>
<a href="../src/isdata.h">src/isdata.h</a>,
<a href="../src/istack.c">src/istack.c</a>,
<a href="../src/istack.h">src/istack.h</a>,
<a href="../src/istkparm.h">src/istkparm.h</a>.

<dt>
Specific stacks:
<dd>

<dl>

<dt>
Dictionary stack:
<dd>
<a href="../src/dstack.h">src/dstack.h</a>,
<a href="../src/iddstack.h">src/iddstack.h</a>,
<a href="../src/idsdata.h">src/idsdata.h</a>,
<a href="../src/idstack.c">src/idstack.c</a>,
<a href="../src/idstack.h">src/idstack.h</a>.

<dt>
Execution stack:
<dd>
<a href="../src/estack.h">src/estack.h</a>,
<a href="../src/iesdata.h">src/iesdata.h</a>,
<a href="../src/iestack.h">src/iestack.h</a>.

<dt>
Operand stack:
<dd>
<a href="../src/iosdata.h">src/iosdata.h</a>,
<a href="../src/iostack.h">src/iostack.h</a>,
<a href="../src/ostack.h">src/ostack.h</a>.

</dl>

</dl>

<h4><a name="Interpreter_loop"></a>Interpreter loop</h4>

<dl>

<dt>
Files:
<dd>
<a href="../src/interp.c">src/interp.c</a>,
<a href="../src/interp.h">src/interp.h</a>.

</dl>

<h4><a name="Scanning_parsing"></a>Scanning/parsing</h4>

<p>
PostScript parsing consists essentially of token scanning, and is simple in
principle.  The scanner is complex because it must be able to suspend its
operation at any time (i.e., between any two input characters) to allow an
interpreter callout, if its input is coming from a procedure-based stream
and the procedure must be called to provide more input data.

<dl>

<dt>
Main scanner:
<dd>
<a href="../src/iscan.c">src/iscan.c</a>,
<a href="../src/iscan.h">src/iscan.h</a>,
<a href="../src/iscannum.c">src/iscannum.c</a>,
<a href="../src/iscannum.h">src/iscannum.h</a>,
<a href="../src/scanchar.h">src/scanchar.h</a>,
<a href="../src/scantab.c">src/scantab.c</a>.

<dt>
Binary tokens:
<dd>
<a href="../src/btoken.h">src/btoken.h</a>,
<a href="../src/ibnum.c">src/ibnum.c</a>,
<a href="../src/ibnum.h">src/ibnum.h</a>,
<a href="../src/inobtokn.c">src/inobtokn.c</a>,
<a href="../src/iscanbin.c">src/iscanbin.c</a>,
<a href="../src/iscanbin.h">src/iscanbin.h</a>.

<dt>
DSC parsing:
<dd>
<a href="../src/dscparse.c">src/dscparse.c</a>,
<a href="../src/dscparse.h">src/dscparse.h</a>.

</dl>

<h4><a name="Standard_operators"></a>Standard operators</h4>

<dl>

<dt>
Non-output-related:
<dd>

<dl>

<dt>
Filters:
<dd>
<a href="../src/ifilter.h">src/ifilter.h</a>,
<a href="../src/ifilter2.h">src/ifilter2.h</a>,
<a href="../src/ifrpred.h">src/ifrpred.h</a>,
<a href="../src/ifwpred.h">src/ifwpred.h</a>,
<a href="../src/istream.h">src/istream.h</a>,
<a href="../src/zfbcp.c">src/zfbcp.c</a>,
<a href="../src/zfdctd.c">src/zfdctd.c</a>,
<a href="../src/zfdcte.c">src/zfdcte.c</a>,
<a href="../src/zfdecode.c">src/zfdecode.c</a>,
<a href="../src/zfilter.c">src/zfilter.c</a>,
<a href="../src/zfilter2.c">src/zfilter2.c</a>,
<a href="../src/zfilterx.c">src/zfilterx.c</a>,
<a href="../src/zfjbig2.c">src/zfjbig2.c</a>,
<a href="../src/zfmd5.c">src/zfmd5.c</a>,
<a href="../src/zfarc4.c">src/zfarc4.c</a>,
<a href="../src/zfproc.c">src/zfproc.c</a>,
<a href="../src/zfrsd.c">src/zfrsd.c</a>,
<a href="../src/zfzlib.c">src/zfzlib.c</a>.

<dt>
File and stream I/O:
<dd>
<a href="../src/files.h">src/files.h</a>,
<a href="../src/itoken.h">src/itoken.h</a>,
<a href="../src/zbseq.c">src/zbseq.c</a>,
<a href="../src/zdscpars.c">src/zdscpars.c</a>,
<a href="../src/zfile.c">src/zfile.c</a>,
<a href="../src/zfile1.c">src/zfile1.c</a>,
<a href="../src/zfileio.c">src/zfileio.c</a>,
<a href="../src/ztoken.c">src/ztoken.c</a>.

<dt>
Data structures:
<dd>
<a href="../src/zarray.c">src/zarray.c</a>,
<a href="../src/zdict.c">src/zdict.c</a>,
<a href="../src/zgeneric.c">src/zgeneric.c</a>,
<a href="../src/zpacked.c">src/zpacked.c</a>,
<a href="../src/zstring.c">src/zstring.c</a>.

<dt>
Functions:
<dd>
<a href="../src/ifunc.h">src/ifunc.h</a>,
<a href="../src/zfunc.c">src/zfunc.c</a>,
<a href="../src/zfunc0.c">src/zfunc0.c</a>,
<a href="../src/zfunc3.c">src/zfunc3.c</a>,
<a href="../src/zfunc4.c">src/zfunc4.c</a>,

<dt>
Other:
<dd>
<a href="../src/ivmem2.h">src/ivmem2.h</a>,
<a href="../src/zarith.c">src/zarith.c</a>,
<a href="../src/zcontext.c">src/zcontext.c</a>,
<a href="../src/zcontrol.c">src/zcontrol.c</a>,
<a href="../src/zmath.c">src/zmath.c</a>,
<a href="../src/zmatrix.c">src/zmatrix.c</a>,
<a href="../src/zmisc.c">src/zmisc.c</a>,
<a href="../src/zmisc1.c">src/zmisc1.c</a>,
<a href="../src/zmisc2.c">src/zmisc2.c</a>,
<a href="../src/zmisc3.c">src/zmisc3.c</a>,
<a href="../src/zrelbit.c">src/zrelbit.c</a>,
<a href="../src/zstack.c">src/zstack.c</a>,
<a href="../src/ztype.c">src/ztype.c</a>,
<a href="../src/zusparam.c">src/zusparam.c</a>,
<a href="../src/zvmem.c">src/zvmem.c</a>,
<a href="../src/zvmem2.c">src/zvmem2.c</a>.

</dl>

<dt>
Output-related:
<dd>

<dl>

<dt>
Device management:
<dd>
<a href="../src/zdevcal.c">src/zdevcal.c</a>,
<a href="../src/zdevice.c">src/zdevice.c</a>,
<a href="../src/zdevice2.c">src/zdevice2.c</a>,
<a href="../src/ziodev.c">src/ziodev.c</a>,
<a href="../src/ziodev2.c">src/ziodev2.c</a>,
<a href="../src/ziodevs.c">src/ziodevs.c</a>,
<a href="../src/ziodevsc.c">src/ziodevsc.c</a>,
<a href="../src/ziodevst.c">src/ziodevst.c</a>,
<a href="../src/zmedia2.c">src/zmedia2.c</a>,
<a href="../src/zdfilter.c">src/zdfilter.c</a>.

<dt>
Fonts and text:
<dd>
<a href="../src/bfont.h">src/bfont.h</a>,
<a href="../src/ccfont.h">src/ccfont.h</a>,
<a href="../src/iccfont.c">src/iccfont.c</a>,
<a href="../src/icfontab.c">src/icfontab.c</a>,
<a href="../src/ichar.h">src/ichar.h</a>,
<a href="../src/ichar1.h">src/ichar1.h</a>,
<a href="../src/icharout.h">src/icharout.h</a>,
<a href="../src/icid.h">src/icid.h</a>,
<a href="../src/ifcid.h">src/ifcid.h</a>,
<a href="../src/ifont.h">src/ifont.h</a>,
<a href="../src/ifont1.h">src/ifont1.h</a>,
<a href="../src/ifont2.h">src/ifont2.h</a>,
<a href="../src/ifont42.h">src/ifont42.h</a>,
<a href="../src/zbfont.c">src/zbfont.c</a>,
<a href="../src/zcfont.c">src/zcfont.c</a>,
<a href="../src/zchar.c">src/zchar.c</a>,
<a href="../src/zchar1.c">src/zchar1.c</a>,
<a href="../src/zchar2.c">src/zchar2.c</a>,
<a href="../src/zchar32.c">src/zchar32.c</a>,
<a href="../src/zchar42.c">src/zchar42.c</a>,
<a href="../src/zchar42.h">src/zchar42.h</a>,
<a href="../src/zcharout.c">src/zcharout.c</a>,
<a href="../src/zcharx.c">src/zcharx.c</a>,
<a href="../src/zcid.c">src/zcid.c</a>,
<a href="../src/zcidtest.c">src/zcidtest.c</a>,
<a href="../src/zfcid.c">src/zfcid.c</a>,
<a href="../src/zfcid0.c">src/zfcid0.c</a>,
<a href="../src/zfcid1.c">src/zfcid1.c</a>,
<a href="../src/zfcmap.c">src/zfcmap.c</a>,
<a href="../src/zfont.c">src/zfont.c</a>,
<a href="../src/zfont0.c">src/zfont0.c</a>,
<a href="../src/zfont1.c">src/zfont1.c</a>,
<a href="../src/zfont2.c">src/zfont2.c</a>,
<a href="../src/zfont32.c">src/zfont32.c</a>,
<a href="../src/zfont42.c">src/zfont42.c</a>,
<a href="../src/zfontenum.c">src/zfontenum.c</a>.

<dt>
A bridge to the True Type bytecode interpreter:
<dd>
<a href="../src/gxttfb.c">src/gxttfb.c</a>,
<a href="../src/gxttfb.h">src/gxttfb.h</a>,
<a href="../src/ttfoutl.h">src/ttfoutl.h</a>,
<a href="../src/ttfmain.c">src/ttfmain.c</a>,
<a href="../src/ttfmemd.c">src/ttfmemd.c</a>,
<a href="../src/ttfmemd.h">src/ttfmemd.h</a>,
<a href="../src/ttfinp.c">src/ttfinp.c</a>,
<a href="../src/ttfinp.h">src/ttfinp.h</a>.

<dt>
A reduced True Type bytecode interpreter (branched from the FreeType 1 project):
<dd>
<a href="../src/ttfsfnt.h">src/ttfsfnt.h</a>,
<a href="../src/ttcalc.c">src/ttcalc.c</a>,
<a href="../src/ttcalc.h">src/ttcalc.h</a>,
<a href="../src/ttcommon.h">src/ttcommon.h</a>,
<a href="../src/ttconf.h">src/ttconf.h</a>,
<a href="../src/ttconfig.h">src/ttconfig.h</a>,
<a href="../src/ttinterp.c">src/ttinterp.c</a>,
<a href="../src/ttinterp.h">src/ttinterp.h</a>,
<a href="../src/ttload.c">src/ttload.c</a>,
<a href="../src/ttload.h">src/ttload.h</a>,
<a href="../src/ttmisc.h">src/ttmisc.h</a>,
<a href="../src/ttobjs.c">src/ttobjs.c</a>,
<a href="../src/ttobjs.h">src/ttobjs.h</a>,
<a href="../src/tttables.h">src/tttables.h</a>,
<a href="../src/tttype.h">src/tttype.h</a>,
<a href="../src/tttypes.h">src/tttypes.h</a>.

<dt>
Color, pattern, and halftone:
<dd>
<a href="../src/icie.h">src/icie.h</a>,
<a href="../src/icolor.h">src/icolor.h</a>,
<a href="../src/icremap.h">src/icremap.h</a>,
<a href="../src/icsmap.h">src/icsmap.h</a>,
<a href="../src/iht.h">src/iht.h</a>,
<a href="../src/ipcolor.h">src/ipcolor.h</a>,
<a href="../src/zcie.c">src/zcie.c</a>,
<a href="../src/zcolor.c">src/zcolor.c</a>,
<a href="../src/zcolor1.c">src/zcolor1.c</a>,
<a href="../src/zcolor2.c">src/zcolor2.c</a>,
<a href="../src/zcolor3.c">src/zcolor3.c</a>,
<a href="../src/zcrd.c">src/zcrd.c</a>,
<a href="../src/zcsdevn.c">src/zcsdevn.c</a>,
<a href="../src/zcsindex.c">src/zcsindex.c</a>,
<a href="../src/zcspixel.c">src/zcspixel.c</a>,
<a href="../src/zcssepr.c">src/zcssepr.c</a>,
<a href="../src/zicc.c">src/zicc.c</a>,
<a href="../src/zhsb.c">src/zhsb.c</a>,
<a href="../src/zht.c">src/zht.c</a>,
<a href="../src/zht1.c">src/zht1.c</a>,
<a href="../src/zht2.h">src/zht2.h</a>,
<a href="../src/zht2.c">src/zht2.c</a>,
<a href="../src/zpcolor.c">src/zpcolor.c</a>,
<a href="../src/zshade.c">src/zshade.c</a>,
<a href="../src/ztrans.c">src/ztrans.c</a>.

<dt>
Images:
<dd>
<a href="../src/iimage.h">src/iimage.h</a>,
<a href="../src/iimage2.h">src/iimage2.h</a>,
<a href="../src/zimage.c">src/zimage.c</a>,
<a href="../src/zimage2.c">src/zimage2.c</a>,
<a href="../src/zimage3.c">src/zimage3.c</a>.

<dt>
Other graphics:
<dd>
<a href="../src/igstate.h">src/igstate.h</a>,
<a href="../src/zdpnext.c">src/zdpnext.c</a>,
<a href="../src/zdps.c">src/zdps.c</a>,
<a href="../src/zdps1.c">src/zdps1.c</a>,
<a href="../src/zgstate.c">src/zgstate.c</a>,
<a href="../src/zpaint.c">src/zpaint.c</a>,
<a href="../src/zpath.c">src/zpath.c</a>,
<a href="../src/zpath1.c">src/zpath1.c</a>,
<a href="../src/zrop.c">src/zrop.c</a>,
<a href="../src/ztrap.c">src/ztrap.c</a>,
<a href="../src/zupath.c">src/zupath.c</a>.

</dl>

<dt>
Operator support:
<dd>
<a href="../src/oparc.h">src/oparc.h</a>,
<a href="../src/opcheck.h">src/opcheck.h</a>,
<a href="../src/opdef.h">src/opdef.h</a>,
<a href="../src/oper.h">src/oper.h</a>,
<a href="../src/opextern.h">src/opextern.h</a>.

</dl>

<h4><a name="Non_standard_operators"></a>Non-standard operators</h4>

<p>
The interpreter includes many non-standard operators.  Most of these provide
some part of the function of a standard operator, so that the standard
operator itself can be implemented in PostScript: these are not of interest
to users, and their function is usually obvious from the way they are used.
However, some non-standard operators provide access to additional,
non-standard facilities that users might want to know about, such as
transparency, RasterOp, and in-memory rendering.  These are documented at <a
href="Language.htm#Additional_operators">Language.htm#Additional_operators</a>.

<p>
We don't document the complete set of non-standard operators here, because
the set changes frequently.  However, all non-standard operators are
supposed to have names that begin with '.', so you can find them all by
executing the following (Unix) command:

<blockquote><pre>
grep '{".[.]' src/[zi]*.c
</pre></blockquote>

<p>
In addition to individual non-standard operators implemented in the same
files as standard ones, there are several independent optional packages of
non-standard operators.  As with other non-standard operators, the names of
all the operators in these packages begin with '.'.  We list those packages
here.

<dl>

<dt>
<a href="../src/zdosio.c">src/zdosio.c</a>
<dd>
Provides access to PC hardware I/O through MS-DOS system calls.  Probably no
longer useful.

<dt>
<a href="../src/zdouble.c">src/zdouble.c</a>
<dd>
Provides "double" floating point arithmetic, using 8-byte strings to hold
values.  Developed under a contract; probably used only by the group that
funded the development.

<dt>
<a href="../src/zfsample.c">src/zfsample.c</a>,
<dd>
Provides a special operator to sample a given function and create a new type 0 function.

<dt>
<a href="../src/zsysvm.c">src/zsysvm.c</a>
<dd>
Provides operators for allocating objects in specific VM spaces,
disregarding the current VM mode.

</dl>

<h4><a name="Interpreter_support"></a>Interpreter support</h4>

<p>
Memory management (refs, GC, save/restore) -- see <a
href="#PostScript_interpreter_extensions">below</a>.

<dl>
<dt>
Font API :
<dd>
<a href="../src/ifapi.h">src/ifapi.h</a>,
<a href="../src/zfapi.c">src/zfapi.c</a>,
<a href="../src/fapiufst.c">src/fapiufst.c</a>,
<a href="../src/fapi_ft.c">src/fapi_ft.c</a>,
<a href="../src/wrfont.h">src/wrfont.h</a>,
<a href="../src/wrfont.c">src/wrfont.c</a>,
<a href="../src/write_t1.h">src/write_t1.h</a>,
<a href="../src/write_t1.c">src/write_t1.c</a>,
<a href="../src/write_t2.h">src/write_t2.h</a>,
<a href="../src/write_t2.c">src/write_t2.c</a>,

<dt>
Miscellaneous support:
<dd>
<a href="../src/ierrors.h">src/ierrors.h</a>,
<a href="../src/errors.h">src/errors.h</a> <em>(deprecated)</em>,
<a href="../src/ghost.h">src/ghost.h</a>,
<a href="../src/iconf.c">src/iconf.c</a>,
<a href="../src/iconf.h">src/iconf.h</a>,
<a href="../src/idparam.c">src/idparam.c</a>,
<a href="../src/idparam.h">src/idparam.h</a>,
<a href="../src/ilevel.h">src/ilevel.h</a>,
<a href="../src/inouparm.c">src/inouparm.c</a>,
<a href="../src/iparam.c">src/iparam.c</a>,
<a href="../src/iparam.h">src/iparam.h</a>,
<a href="../src/iparray.h">src/iparray.h</a>,
<a href="../src/iutil.c">src/iutil.c</a>,
<a href="../src/iutil.h">src/iutil.h</a>,
<a href="../src/iutil2.c">src/iutil2.c</a>,
<a href="../src/iutil2.h">src/iutil2.h</a>,
<a href="../src/iutilasm.asm">src/iutilasm.asm</a>,
<a href="../src/iplugin.c">src/iplugin.c</a>,
<a href="../src/iplugin.h">src/iplugin.h</a>.

</dl>

<h4><a name="PostScript_code"></a>PostScript code</h4>

<dl>

<dt>
Initialization and language support:
<dd>

<dl>

<dt>
All configurations:
<dd>
<a href="../lib/gs_init.ps">lib/gs_init.ps</a>,
<a href="../lib/gs_statd.ps">lib/gs_statd.ps</a>.

<dt>
Level 2:
<dd>
<a href="../lib/gs_btokn.ps">lib/gs_btokn.ps</a>,
<a href="../lib/gs_dps1.ps">lib/gs_dps1.ps</a>,
<a href="../lib/gs_dps2.ps">lib/gs_dps2.ps</a>,
<a href="../lib/gs_lev2.ps">lib/gs_lev2.ps</a>,
<a href="../lib/gs_res.ps">lib/gs_res.ps</a>,
<a href="../lib/gs_resmp.ps">lib/gs_resmp.ps</a>,
<a href="../lib/gs_resst.ps">lib/gs_resst.ps</a>,
<a href="../lib/gs_stres.ps">lib/gs_stres.ps</a>,
<a href="../lib/gs_setpd.ps">lib/gs_setpd.ps</a>.

<dt>
LanguageLevel 3:
<dd>
<a href="../lib/gs_frsd.ps">lib/gs_frsd.ps</a>,
<a href="../lib/gs_ll3.ps">lib/gs_ll3.ps</a>,
<a href="../lib/gs_trap.ps">lib/gs_trap.ps</a>.

<dt>
Display PostScript:
<dd>
<a href="../lib/gs_dpnxt.ps">lib/gs_dpnxt.ps</a>,
<a href="../lib/gs_dps.ps">lib/gs_dps.ps</a>.

</dl>

<dt>
Color Spaces and support:
<dd>

<dl>

<dt>
Color Space Loading:
<dd>
<a href="../lib/gs_ciecs2.ps">lib/gs_ciecs2.ps</a>,
<a href="../lib/gs_ciecs3.ps">lib/gs_ciecs3.ps</a>,
<a href="../lib/gs_cspace.ps">lib/gs_cspace.ps</a>,
<a href="../lib/gs_devcs.ps">lib/gs_devcs.ps</a>,
<a href="../lib/gs_devn.ps">lib/gs_devn.ps</a>,
<a href="../lib/gs_devpxl.ps">lib/gs_devpxl.ps</a>,
<a href="../lib/gs_indxd.ps">lib/gs_indxd.ps</a>,
<a href="../lib/gs_patrn.ps">lib/gs_patrn.ps</a>,
<a href="../lib/gs_sepr.ps">lib/gs_sepr.ps</a>.

<dt>
ICC color profiles:
<dd>
<a href="../lib/gs_icc.ps">lib/gs_icc.ps</a>.

</dl>

<dt>
Font loading and support:
<dd>

<dl>

<dt>
Font name mapping:
<dd>
<a href="../lib/Fontmap">lib/Fontmap</a>,
<a href="../lib/Fontmap.ATB">lib/Fontmap.ATB</a>,
<a href="../lib/Fontmap.ATM">lib/Fontmap.ATM</a>,
<a href="../lib/Fontmap.GS">lib/Fontmap.GS</a>,
<a href="../lib/Fontmap.OS2">lib/Fontmap.OS2</a>,
<a href="../lib/Fontmap.OSF">lib/Fontmap.OSF</a>,
<a href="../lib/Fontmap.SGI">lib/Fontmap.SGI</a>,
<a href="../lib/Fontmap.Sol">lib/Fontmap.Sol</a>,
<a href="../lib/Fontmap.Ult">lib/Fontmap.Ult</a>,
<a href="../lib/Fontmap.VMS">lib/Fontmap.VMS</a>,
<a href="../lib/cidfmap">lib/cidfmap</a>,
<a href="../lib/FAPIcidfmap">lib/FAPIcidfmap</a>,
<a href="../lib/FAPIfontmap">lib/FAPIfontmap</a>.

<dt>
Generic:
<dd>
<a href="../lib/gs_ccfnt.ps">lib/gs_ccfnt.ps</a>,
<a href="../lib/gs_fonts.ps">lib/gs_fonts.ps</a>,
<a href="../lib/gs_fntem.ps">lib/gs_fntem.ps</a>.

<dt>
Type 1 and CFF:
<dd>
<a href="../lib/gs_cff.ps">lib/gs_cff.ps</a>,
<a href="../lib/gs_diskf.ps">lib/gs_diskf.ps</a>,
<a href="../lib/gs_type1.ps">lib/gs_type1.ps</a>.

<dt>
TrueType:
<dd>
<a href="../lib/gs_ttf.ps">lib/gs_ttf.ps</a>,
<a href="../lib/gs_typ42.ps">lib/gs_typ42.ps</a>.

<dt>
CID-keyed:
<dd>
<a href="../lib/gs_cidcm.ps">lib/gs_cidcm.ps</a>,
<a href="../lib/gs_cidfn.ps">lib/gs_cidfn.ps</a>,
<a href="../lib/gs_cmap.ps">lib/gs_cmap.ps</a>,
<a href="../lib/gs_ciddc.ps">lib/gs_ciddc.ps</a>,
<a href="../lib/gs_cidfm.ps">lib/gs_cidfm.ps</a>,
<a href="../lib/gs_cidtt.ps">lib/gs_cidtt.ps</a>.

<dt>
Font API:
<dd>
<a href="../lib/gs_fapi.ps">lib/gs_fapi.ps</a>,
<a href="../lib/FAPIconfig">lib/FAPIconfig</a>,
<a href="../lib/xlatmap">lib/xlatmap</a>.

<dt>
Other:
<dd>
<a href="../lib/gs_kanji.ps">lib/gs_kanji.ps</a>,
<a href="../lib/gs_pfile.ps">lib/gs_pfile.ps</a>,
<a href="../lib/gs_typ32.ps">lib/gs_typ32.ps</a>.

</dl>

<dt>
Encodings:
<dd>

<dl>

<dt>
Adobe-specified:
<dd>
<a href="../lib/gs_ce_e.ps">lib/gs_ce_e.ps</a>,
<a href="../lib/gs_dbt_e.ps">lib/gs_dbt_e.ps</a>,
<a href="../lib/gs_il1_e.ps">lib/gs_il1_e.ps</a>,
<a href="../lib/gs_mex_e.ps">lib/gs_mex_e.ps</a>,
<a href="../lib/gs_mro_e.ps">lib/gs_mro_e.ps</a>,
<a href="../lib/gs_pdf_e.ps">lib/gs_pdf_e.ps</a>,
<a href="../lib/gs_std_e.ps">lib/gs_std_e.ps</a>,
<a href="../lib/gs_sym_e.ps">lib/gs_sym_e.ps</a>,
<a href="../lib/gs_wan_e.ps">lib/gs_wan_e.ps</a>.

<dt>
Additional:
<dd>
<a href="../lib/gs_il2_e.ps">lib/gs_il2_e.ps</a>,
<a href="../lib/gs_ksb_e.ps">lib/gs_ksb_e.ps</a>,
<a href="../lib/gs_wl1_e.ps">lib/gs_wl1_e.ps</a>,
<a href="../lib/gs_wl2_e.ps">lib/gs_wl2_e.ps</a>,
<a href="../lib/gs_wl5_e.ps">lib/gs_wl5_e.ps</a>.

<dt>
Pseudo-encodings for internal use:
<dd>
<a href="../lib/gs_css_e.ps">lib/gs_css_e.ps</a>,
<a href="../lib/gs_lgo_e.ps">lib/gs_lgo_e.ps</a>,
<a href="../lib/gs_lgx_e.ps">lib/gs_lgx_e.ps</a>,
<a href="../lib/gs_mgl_e.ps">lib/gs_mgl_e.ps</a>.

</dl>

<dt>
Miscellaneous:
<dd>

<dl>

<dt>
Image support:
<dd>
<a href="../lib/gs_img.ps">lib/gs_img.ps</a>,

<dt>
Emulation of %disk IODevice:
<dd>
<a href="../lib/gs_diskn.ps">lib/gs_diskn.ps</a>,

<dt>
Other support:
<dd>
<a href="../lib/gs_agl.ps">lib/gs_agl.ps</a>,
<a href="../lib/gs_dscp.ps">lib/gs_dscp.ps</a>,
<a href="../lib/gs_epsf.ps">lib/gs_epsf.ps</a>,
<a href="../lib/gs_pdfwr.ps">lib/gs_pdfwr.ps</a>,
<a href="../lib/gs_rdlin.ps">lib/gs_rdlin.ps</a>.

<dt>
X Windows icon bitmaps:
<dd>
<a href="../lib/gs_l.xbm">lib/gs_l.xbm</a>,
<a href="../lib/gs_l.xpm">lib/gs_l.xpm</a>,
<a href="../lib/gs_l_m.xbm">lib/gs_l_m.xbm</a>,
<a href="../lib/gs_m.xbm">lib/gs_m.xbm</a>,
<a href="../lib/gs_m.xpm">lib/gs_m.xpm</a>,
<a href="../lib/gs_m_m.xbm">lib/gs_m_m.xbm</a>,
<a href="../lib/gs_s.xbm">lib/gs_s.xbm</a>,
<a href="../lib/gs_s.xpm">lib/gs_s.xpm</a>,
<a href="../lib/gs_s_m.xbm">lib/gs_s_m.xbm</a>,
<a href="../lib/gs_t.xbm">lib/gs_t.xbm</a>,
<a href="../lib/gs_t.xpm">lib/gs_t.xpm</a>,
<a href="../lib/gs_t_m.xbm">lib/gs_t_m.xbm</a>.

<dt>
Not currently used:
<dd>
<a href="../lib/gs_cmdl.ps">lib/gs_cmdl.ps</a>,
<a href="../lib/gs_fform.ps">lib/gs_fform.ps</a>,
<a href="../lib/gs_l2img.ps">lib/gs_l2img.ps</a>.

</dl>

</dl>

<h3><a name="PDF_interpreter"></a>PDF interpreter</h3>

<p>
Ghostscript's PDF interpreter is written entirely in PostScript, because its
data structures are the same as PostScript's, and it is much more convenient
to manipulate PostScript-like data structures in PostScript than in C.
There is definitely a performance cost, but apparently not a substantial
one: we considered moving the main interpreter loop (read a token using
slightly different syntax than PostScript, push it on the stack if literal,
look it up in a special dictionary for execution if not) into C, but we did
some profiling and discovered that this wasn't accounting for enough of the
time to be worthwhile.

<p>
Until recently, there was essentially no C code specifically for the purpose
of supporting PDF interpretation.  The one major exception is the PDF 1.4
transparency features, which we (but not Adobe) have made available to
PostScript code.

<p>
In addition to patching the <b><tt>run</tt></b> operator to detect PDF
files, the interpreter provides some procedures in <a
href="../lib/pdf_main.ps">lib/pdf_main.ps</a> that are meant to be called
from applications such as previewers.

<dl>

<dt>
Files:
<dd>
<a href="../lib/pdf_base.ps">lib/pdf_base.ps</a>,
<a href="../lib/pdf_draw.ps">lib/pdf_draw.ps</a>,
<a href="../lib/pdf_font.ps">lib/pdf_font.ps</a>,
<a href="../lib/pdf_main.ps">lib/pdf_main.ps</a>,
<a href="../lib/pdf_rbld.ps">lib/pdf_rbld.ps</a>,
<a href="../lib/pdf_ops.ps">lib/pdf_ops.ps</a>,
<a href="../lib/pdf_sec.ps">lib/pdf_sec.ps</a>.

</dl>

<h3><a name="Build_process"></a>Build process</h3>

<h4><a name="Makefile_structure"></a>Makefile structure</h4>

<p>
Ghostscript's makefiles embody a number of design decisions and assumptions
that may not be obvious from a casual reading of the code.

<ul>

<li>All files are stored in subdirectories.  The names of all subdirectories
used in the build process are defined in the top-level makefiles for the
various platforms: there are no "hard wired" directory names in any makefile
rule.  Subdirectory names in the makefiles are relative to the directory
that is current at build time: normally this directory is the parent of the
various subdirectories, and holds only a <b><tt>makefile</tt></b>, which in
turn simply references the real top-level makefile in the source
subdirectory.

<li>All compiler and linker switches are likewise defined by macros, again
preferably in the top-level platform makefile.

<li>There is an absolute distinction between "source-like" subdirectories,
which are read-only during the build process, and "object-like"
subdirectories, all of whose contents are generated by the build process and
which can be emptied (<b><tt>rm&nbsp;*</tt></b>) at any time with no bad
effects.  The source subdirectories are defined by macros named
<b><tt>xxxSRCDIR</tt></b>.

<li>Object subdirectories may distinguish further between those that hold
the results of the build process that are needed at run time (i.e., that
should be included in a run-time distribution), defined by
<b><tt>BINDIR</tt></b>, and those that are not needed at run time, defined
by <b><tt>xxxGENDIR</tt></b> and <b><tt>xxxOBJDIR</tt></b>.  (The
distinction between these is historical and probably no longer relevant.)

<li>There may be multiple object subdirectories for different build
configurations.  On Unix, the <b><tt>obj</tt></b> and <b><tt>bin</tt></b>
directories are used for normal production builds, the
<b><tt>debugobj</tt></b> directory for debugging builds, and the
<b><tt>pgobj</tt></b> directory for profiling builds; other platforms may
use different conventions.  The Unix makefiles support targets named
<b><tt>debug</tt></b> and <b><tt>pg</tt></b> for debugging and profiling
builds respectively; other platforms generally do not.

<li>Makefiles will be maintained by hand.  This requires editing the
following makefile elements whenever the relevant source files changes:

<ul>

<li>Every header (.h) file must have a corresponding macro definition in a
makefile.  If <b><tt>abc.h</tt></b> #includes <b><tt>def.h</tt></b> and
<b><tt>xyz.h</tt></b>, the definition must have the form

<blockquote><pre>
xyz_h=$(xxxSRCD)xyz.h $(def_h) $(xyz_h)
</pre></blockquote>

where <b><tt>xxxSRCD</tt></b> is the macro defining the relevant source
directory (including a trailing '/').  Note that the '.' in the file name
has been replaced by an underscore.  Note also that the definition must
follow all definitions it references, since some <b><tt>make</tt></b>
programs expand macros in definitions at the time of definition rather than
at the time of use.

<li>Every .c file must have a corresponding rule in a makefile.  If
<b><tt>abc.c</tt></b> #includes <b><tt>def.h</tt></b> and
<b><tt>lmn.h</tt></b>, the rule must have approximately the form

<blockquote><pre>
$(xxxOBJD)abc.$(OBJ) : $(xxxSRCD)abc.c $(def_h) $(lmn_h)
    $(xxCC) $(xxO_)abc.$(OBJ) $(C_) $(xxxSRCD)abc.c
</pre></blockquote>

where <b><tt>xxxSRCD</tt></b> is as before; <b><tt>xxxOBJD</tt></b> is the
relevant object directory; <b><tt>xxCC</tt></b> defines the name of the C
compiler plus the relevant compilation switches; and <b><tt>xxO_</tt></b>
and <b><tt>C_</tt></b> are macros used to bridge syntactic differences
between different <b><tt>make</tt></b> programs.

</ul>

</ul>

<p>
The requirement to keep makefiles up to date by hand has been controversial.
Two alternatives are generally proposed.

<ul>

<li>Programs like <b><tt>makedeps</tt></b>, which generate build rules
automatically from the #include lists in C files.  We have found such
programs useless: they "wire in" specific, concrete directory names, not
only for our own code but even for the system header files; they have to be
run manually whenever code files are added, renamed, or deleted, or whenever
the list of #includes in any file changes; and they cannot deal with
different source files requiring different compilation switches.

<li>MSVC-style "project" files.  These are equally useless: they are not
portable across different vendors' tools -- in fact, there may not even be a
usable import/export facility to convert their data to or from text form --
and they cannot combine configuration-independent data with
configuration-specific data.

</ul>

<p>
We have seriously considered writing our own build program in Tcl or Python
that would eliminate these problems, or perhaps porting the tools developed
by Digital's Vesta research project (if we can get access to them); however,
either of these approaches would create potential portability problems of
its own, not to mention difficulties in integrating with others' build
systems.

<p>
For more information about makefiles:

<ul>

<li>For a detailed list of makefiles, and a discussion of makefile issues
related to portability, see the <a href="#Makefiles">Makefiles</a> section
below.

<li>For more detailed information about editing configuration information in
makefiles, see <a
href="Make.htm#Makefile_overview">doc/Make.htm#Makefile_overview</a>.

<li>For a complete example of adding a new driver to a makefile, see <a
href="Drivers.htm#Adding_drivers">doc/Drivers.htm#Adding_drivers</a>.

<li>For a few more notes on makefile coding conventions, see <a
href="C-style.htm#Makefiles">doc/C-style.htm#Makefiles</a>.

</ul>

<h4><a name="dev_files"></a>.dev files</h4>

<p>
On top of the general conventions just described, Ghostscript's makefiles
add a further layer of structure in order to support an open-ended set of
fine-grained, flexible configuration options.  Selecting an option (usually
called a "module") for inclusion in the build may affect the build in many
ways:

<ul>

<li>Almost always, it requires linking in some compiled code files.

<li>It may require running some additional initialization procedures at
startup.

<li>It may require reading in some additional PostScript files at startup.
For example, a Level 2 PostScript build requires support for PostScript
resources and for setpagedevice, which are implemented in PostScript code.

<li>It may require adding entries to a variety of internal tables that
catalogue such things as drivers, IODevices, Function types, etc.

<li>It may require that other particular modules be included.  For example,
the "PostScript Level 2" module requires the modules for various filters,
color spaces, etc.

<li>It may require <em>removing</em> some other (default) module from the
build.  For example, the core (Level 1) PostScript build has a "stub" for
binary tokens, which are a Level 2 feature but are referenced by the core
scanner: a Level 2 build must remove the stub.  For more information about
this, look for the string <b><tt>-replace</tt></b> in the makefiles and in
<a href="../src/genconf.c">src/genconf.c</a>.

</ul>

<p>
Each module is defined in the makefiles by rules that create a file named
<b><em>xxx</em><tt>.dev</tt></b>.  The dependencies of the rule include all
the files that make up the module (compiled code files, PostScript files,
etc.); the body of the rule creates the .dev file by writing the description
of the module into it.  A program called <b><tt>genconf</tt></b>, described
in the next section, merges all the relevant .dev files together.  For
examples of .dev rules, see any of the Ghostscript makefiles.

<p>
Ultimately, a person must specify the root set of modules to include in a
build (which of course may require other modules, recursively).
Ghostscript's makefiles do this with a set of macros called
<b><tt>FEATURE_DEVS</tt></b> and <b><tt>DEVICE_DEVS</tt>n</b>, defined in
each top-level makefile, but nothing in the module machinery depends on
this.

<h4><a name="Generators"></a>Generators</h4>

<p>
Ghostscript's build procedure is somewhat unusual in that it compiles and
then executes some support programs during the build process.  These
programs then generate data or source code that is used later on in the
build.

<p>
The most important and complex of the generator programs is
<b><tt>genconf</tt></b>.  <b><tt>genconf</tt></b> merges all the .dev files
that make up the build, and creates three or more output files used in later
stages:

<ul>

<li><b><tt>gconfig.h</tt></b>, consisting mainly of macro calls, one call
per "resource" making up the build, other than "resources" listed in the
other output files.

<li><b><tt>gconfigf.h</tt></b>, produced only for PostScript builds with
compiled-in fonts, consisting of one macro call per font.

<li>A linker control file whose name varies from one platform to another,
containing the list of compiled code files to be linked.

<li>If necessary, another linker control file, also varying between
platforms, that contains other information for the linker such as the list
of system libraries to be searched.  (On Unix platforms, the two linker
control functions are combined in a single file.)

</ul>

<dl>

<dt>
Source generators:
<dd>

<dl>

<dt>
<a href="../src/genarch.c">src/genarch.c</a>
<dd>
Creates a header file containing a variety of information about the hardware
and compiler that isn't provided in any standard system header file.  Always
used.

<dt>
<a href="../src/genconf.c">src/genconf.c</a> (also generates non-source)
<dd>
Constructs header files and linker control files from the collection of
options and modules that make up the build.  See above.  Always used.

<dt>
<a href="../src/genht.c">src/genht.c</a>
<dd>
Converts a PostScript halftone (in a particular constrained format) to a C
data structure that can be compiled into an executable.  Only used if any
such halftones are included in the build.

<dt>
<a href="../src/geninit.c">src/geninit.c</a>
<dd>
Converts PostScript initialization files to C data structures that can be
compiled into an executable.  Only used when building a PostScript
interpreter, and only if <b><tt>COMPILE_INITS</tt></b> was set to 1 in the
makefile.

</dl>

<dt>
Other generators:
<dd>

<dl>

<dt>
<a href="../src/echogs.c">src/echogs.c</a>
<dd>
Implements a variety of shell-like functions to get around quirks,
limitations, and omissions in the shells on various platforms.  Always used.

<dt>
<a href="../src/genconf.c">src/genconf.c</a> (also generates source)
<dd>
See above.

<dt>
<a href="../src/gendev.c">src/gendev.c</a> (not used)
<dd>
Was intended as a replacement for <b><tt>genconf</tt></b>, but was never
completed.

</dl>

</dl>

<h4><a name="Build_support"></a>Support</h4>

<p>
There are a number of programs, scripts, and configuration files that exist
only for the sake of the build process.

<dl>

<dt>
Files for PC environments:
<dd>
<a href="../src/gswin.icx">src/gswin.icx</a>,
<a href="../src/gswin16.icx">src/gswin16.icx</a>,
<a href="../src/bcc32.cfg">src/bcc32.cfg</a>,
<a href="../src/cp.bat">src/cp.bat</a>,
<a href="../src/cp.cmd">src/cp.cmd</a>,
<a href="../src/dw32c.def">src/dw32c.def</a>,
<a href="../src/dwmain.rc">src/dwmain.rc</a>,
<a href="../src/dwmain16.def">src/dwmain16.def</a>,
<a href="../src/dwmain32.def">src/dwmain32.def</a>,
<a href="../src/dwsetup.def">src/dwsetup.def</a>,
<a href="../src/dwsetup.rc">src/dwsetup.rc</a>,
<a href="../src/dwuninst.def">src/dwuninst.def</a>,
<a href="../src/dwuninst.rc">src/dwuninst.rc</a>,
<a href="../src/gs16spl.def">src/gs16spl.def</a>,
<a href="../src/gs16spl.rc">src/gs16spl.rc</a>,
<a href="../src/gsdll2.def">src/gsdll2.def</a>,
<a href="../src/gsdll2.rc">src/gsdll2.rc</a>,
<a href="../src/gsdll32.def">src/gsdll32.def</a>,
<a href="../src/gsdll32.rc">src/gsdll32.rc</a>,
<a href="../src/gsdll32w.lnk">src/gsdll32w.lnk</a>,
<a href="../src/gsos2.def">src/gsos2.def</a>,
<a href="../src/gsos2.icx">src/gsos2.icx</a>,
<a href="../src/gsos2.rc">src/gsos2.rc</a>,
<a href="../src/gspmdrv.def">src/gspmdrv.def</a>,
<a href="../src/gspmdrv.icx">src/gspmdrv.icx</a>,
<a href="../src/gspmdrv.rc">src/gspmdrv.rc</a>,
<a href="../src/gswin.rc">src/gswin.rc</a>,
<a href="../src/gswin32.rc">src/gswin32.rc</a>,
<a href="../src/gswin386.rc">src/gswin386.rc</a>,
<a href="../src/mv.bat">src/mv.bat</a>,
<a href="../src/mv.cmd">src/mv.cmd</a>,
<a href="../src/rm.bat">src/rm.bat</a>,
<a href="../src/rm.cmd">src/rm.cmd</a>,
<a href="../src/turboc.cfg">src/turboc.cfg</a>.

<dt>
Files for MacOS:
<dd>
<a href="../lib/Info-macos.plist">lib/Info-macos.plist</a>.

<dt>
Files for OpenVMS:
<dd>
<a href="../src/append_l.com">src/append_l.com</a>,
<a href="../src/copy_one.com">src/copy_one.com</a>,
<a href="../src/rm_all.com">src/rm_all.com</a>,
<a href="../src/rm_one.com">src/rm_one.com</a>.

<dt>
Other files:
<dd>
<a href="../src/bench.c">src/bench.c</a>,
<a href="../src/catmake">src/catmake</a>,
<a href="../src/instcopy">src/instcopy</a>.

</dl>

<h3><a name="Utilities"></a>Utilities</h3>

<p>
Ghostscript comes with many utilities for doing things like viewing bitmap
files and converting between file formats.  Some of these are written in
PostScript, some as scripts, and some as scripts that invoke special
PostScript code.

<h4><a name="Utilities_in_PostScript"></a>Utilities in PostScript</h4>

<p>
These are all documented in <a href="Psfiles.htm">doc/Psfiles.htm</a>, q.v.

<h4><a name="Utility_scripts"></a>Utility scripts</h4>

<p>
Many of these scripts come in both Unix and MS-DOS (<b><tt>.bat</tt></b>
versions; some also have an OS/2 (<b><tt>.cmd</tt></b>) version.  The choice
of which versions are provided is historical and irregular.  These scripts
should all be documented somewhere, but currently, many of them have man
pages, a few have their own documentation in the doc directory, and some
aren't documented at all.

<dl>

<dt>
Script files without PC versions:
<dd>
<a href="../lib/afmdiff.awk">lib/afmdiff.awk</a>,
<a href="../lib/dvipdf">lib/dvipdf</a>,
<a href="../lib/fixmswrd.pl">lib/fixmswrd.pl</a>,
<a href="../lib/lprsetup.sh">lib/lprsetup.sh</a>,
<a href="../lib/pj-gs.sh">lib/pj-gs.sh</a>,
<a href="../lib/pphs">lib/pphs</a>,
<a href="../lib/printafm">lib/printafm</a>,
<a href="../lib/pv.sh">lib/pv.sh</a>,
<a href="../lib/sysvlp.sh">lib/sysvlp.sh</a>,
<a href="../lib/unix-lpr.sh">lib/unix-lpr.sh</a>,
<a href="../lib/wftopfa">lib/wftopfa</a>.

<dt>
Script files with PC versions:
<dd>
<a href="../lib/bdftops">lib/bdftops</a>,
<a href="../lib/bdftops.bat">lib/bdftops.bat</a>,
<a href="../lib/bdftops.cmd">lib/bdftops.cmd</a>,
<a href="../lib/dumphint">lib/dumphint</a>,
<a href="../lib/dumphint.bat">lib/dumphint.bat</a>,
<a href="../lib/eps2eps">lib/eps2eps</a>,
<a href="../lib/eps2eps.bat">lib/eps2eps.bat</a>,
<a href="../lib/eps2eps.cmd">lib/eps2eps.cmd</a>,
<a href="../lib/font2c">lib/font2c</a>,
<a href="../lib/font2c.bat">lib/font2c.bat</a>,
<a href="../lib/font2c.cmd">lib/font2c.cmd</a>,
<a href="../lib/gsbj">lib/gsbj</a>,
<a href="../lib/gsbj.bat">lib/gsbj.bat</a>,
<a href="../lib/gsdj">lib/gsdj</a>,
<a href="../lib/gsdj.bat">lib/gsdj.bat</a>,
<a href="../lib/gsdj500">lib/gsdj500</a>,
<a href="../lib/gsdj500.bat">lib/gsdj500.bat</a>,
<a href="../lib/gslj">lib/gslj</a>,
<a href="../lib/gslj.bat">lib/gslj.bat</a>,
<a href="../lib/gslp">lib/gslp</a>,
<a href="../lib/gslp.bat">lib/gslp.bat</a>,
<a href="../lib/gsnd">lib/gsnd</a>,
<a href="../lib/gsnd.bat">lib/gsnd.bat</a>,
<a href="../lib/pdf2dsc">lib/pdf2dsc</a>,
<a href="../lib/pdf2dsc.bat">lib/pdf2dsc.bat</a>,
<a href="../lib/pdf2ps">lib/pdf2ps</a>,
<a href="../lib/pdf2ps.bat">lib/pdf2ps.bat</a>,
<a href="../lib/pdf2ps.cmd">lib/pdf2ps.cmd</a>,
<a href="../lib/pdfopt">lib/pdfopt</a>,
<a href="../lib/pdfopt.bat">lib/pdfopt.bat</a>,
<a href="../lib/pf2afm">lib/pf2afm</a>,
<a href="../lib/pf2afm.bat">lib/pf2afm.bat</a>,
<a href="../lib/pf2afm.cmd">lib/pf2afm.cmd</a>,
<a href="../lib/pfbtopfa">lib/pfbtopfa</a>,
<a href="../lib/pfbtopfa.bat">lib/pfbtopfa.bat</a>,
<a href="../lib/ps2ascii">lib/ps2ascii</a>,
<a href="../lib/ps2ascii.bat">lib/ps2ascii.bat</a>,
<a href="../lib/ps2ascii.cmd">lib/ps2ascii.cmd</a>,
<a href="../lib/ps2epsi">lib/ps2epsi</a>,
<a href="../lib/ps2epsi.bat">lib/ps2epsi.bat</a>,
<a href="../lib/ps2epsi.cmd">lib/ps2epsi.cmd</a>,
<a href="../lib/ps2pdf">lib/ps2pdf</a>,
<a href="../lib/ps2pdf.bat">lib/ps2pdf.bat</a>,
<a href="../lib/ps2pdf.cmd">lib/ps2pdf.cmd</a>,
<a href="../lib/ps2pdf12">lib/ps2pdf12</a>,
<a href="../lib/ps2pdf12.bat">lib/ps2pdf12.bat</a>,
<a href="../lib/ps2pdf12.cmd">lib/ps2pdf12.cmd</a>,
<a href="../lib/ps2pdf13">lib/ps2pdf13</a>,
<a href="../lib/ps2pdf13.bat">lib/ps2pdf13.bat</a>,
<a href="../lib/ps2pdf13.cmd">lib/ps2pdf13.cmd</a>,
<a href="../lib/ps2pdf14">lib/ps2pdf14</a>,
<a href="../lib/ps2pdf14.bat">lib/ps2pdf14.bat</a>,
<a href="../lib/ps2pdf14.cmd">lib/ps2pdf14.cmd</a>,
<a href="../lib/ps2pdfwr">lib/ps2pdfwr</a>,
<a href="../lib/ps2pdfxx.bat">lib/ps2pdfxx.bat</a>,
<a href="../lib/ps2ps">lib/ps2ps</a>,
<a href="../lib/ps2ps.bat">lib/ps2ps.bat</a>,
<a href="../lib/ps2ps.cmd">lib/ps2ps.cmd</a>.

<dt>
Script files with only PC versions:
<dd>
<a href="../lib/gsndt.bat">lib/gsndt.bat</a>,
<a href="../lib/gssetgs.bat">lib/gssetgs.bat</a>,
<a href="../lib/gst.bat">lib/gst.bat</a>,
<a href="../lib/gstt.bat">lib/gstt.bat</a>,
<a href="../lib/lp386.bat">lib/lp386.bat</a>,
<a href="../lib/lp386r2.bat">lib/lp386r2.bat</a>,
<a href="../lib/lpgs.bat">lib/lpgs.bat</a>,
<a href="../lib/lpr2.bat">lib/lpr2.bat</a>,
<a href="../lib/pftogsf.bat">lib/pftogsf.bat</a>,
<a href="../lib/wmakebat.bat">lib/wmakebat.bat</a>.

</dl>

<hr>

<h2><a name="Memory_management"></a>Memory management</h2>

<h3><a name="Memory_manager_architecture"></a>Memory manager architecture</h3>

<p>
In many environments, the memory manager is a set of library facilities that
implicitly manage the entire address space in a homogenous manner.
Ghostscript's memory manager architecture has none of these properties:

<ul>

<li>Rather than a single library accessed as procedures, Ghostscript
includes multiple allocator types, each of which in turn may have multiple
instances (allocators).  Allocators are 'objects' with a substantial set of
virtual functions.

<li>Rather than managing the entire address space, each allocator manages a
storage pool, which it may or may not be able to expand or reduce by calling
on a 'parent' allocator.

<li>Rather than a single genus of untyped storage blocks, Ghostscript's
allocators provide two genera -- type-tagged 'objects', and 'strings' --
with substantially different properties.

</ul>

<h4><a name="Objects_vs_strings"></a>Objects vs strings</h4>

<p>
As noted above, allocators provide two different storage genera.

<p>
Objects:

<ul>
<li>Are aligned in storage to satisfy the most stringent alignment
requirement imposed by the CPU or compiler;
<li>Can be referenced only by pointers to their start, not to any internal
location, unless special arrangements are made;
<li>May contain pointers to other objects, or to strings;
<li>Have an associated <em>structure descriptor</em> that specifies their
size (usually) and the location of any pointers contained within them.
</ul>

<p>
Given a pointer to an object, the allocator that allocated it must be able
to return the object's size and the pointer to its structure descriptor.
(It is up to the client to know what allocator allocated an object.)

<p>
Strings:

<ul>
<li>Are not aligned in storage;
<li>Can be referenced by pointers (consisting of a starting address and a
length) to any substring, starting anywhere within the string;
<li>May not contain pointers;
<li>Do not have a structure descriptor.
</ul>

<p>
The object/string distinction reflects a space/capability tradeoff.  The
per-object space overhead of the standard type of allocator is typically 12
bytes; this is too much to impose on every string of a few bytes.  On the
other hand, restricting object pointers to reference the start of the object
currently makes object garbage collection and compaction more
space-efficient.  If we were to redesign the standard allocator, we would
probably opt for a different design in which strings were allocated within
container objects of a few hundred bytes, and pointers into the middle of
all objects were allowed.

<h4><a name="Structure_descriptors"></a>Structure descriptors</h4>

<p>
Every object allocated by a Ghostscript allocator has an associated
structure descriptor, which the caller provides when allocating the object.
The structure descriptor serves several purposes:

<ul>
<li>Specifying the size of the object for allocation;
<li>Providing pointer-enumeration and pointer-relocation procedures for
the garbage collector;
<li>Providing an optional finalization procedure to be called when the
object is freed (either explicitly or automatically).
</ul>

<p>
Structure descriptors are read-only, and are normally defined statically
using one of the large set of <b><tt>gs_private_st_</tt></b> or
<b><tt>gs_public_st_</tt></b> macros in <a
href="../src/gsstruct.h">src/gsstruct.h</a>.

<p>
While the structure descriptor normally specifies the size of the object,
one can also allocate an array of bytes or objects, whose size is a multiple
of the size in the descriptor.  For this reason, every object stores its
size as well as a reference to its descriptor.

<p>
Because the standard Ghostscript garbage collector is non-conservative and
can move objects, every object allocated by a Ghostscript allocator must
have an accurate structure descriptor.  If you define a new type of object
(structure) that will be allocated in storage managed by Ghostscript, you
<em>must</em> create an accurate descriptor for it, and use that descriptor
to allocate it.  The process of creating accurate descriptors for all
structures was long and painful, and accounted for many hard-to-diagnose
bugs.

<p>
By convention, the structure descriptor for structure type
<b><tt>xxx_t</tt></b> is named <b><tt>st_xxx</tt></b> (this is preferred),
or occasionally <b><tt>st_xxx_t</tt></b>.

<p>
Note that a structure descriptor is only required for objects allocated by
the Ghostscript allocator.  A structure type <b><tt>xxx_t</tt></b> does not
require a structure descriptor if instances of that type are used
<em>only</em> in the following ways:

<ul>

<li>Instances are allocated only on the C stack, e.g., as
<b><tt>xxx_t&nbsp;xxx1,&nbsp;xxx2;</tt></b>, or on the C heap, with
<b><tt>malloc</tt></b> or through the Ghostscript "wrapper" defined in <a
href="../src/gsmalloc.h">src/gsmalloc.h</a>.

<li>Pointers to instances are not stored in places where the garbage
collector will try to trace the pointer.

<li>Code never attempts to get the structure type or size of an instance
through the allocator API.

</ul>

<p>
In general, structures without descriptors are problem-prone, and are
deprecated; in new code, they should only be used if the structure is
confined to a single .c file and its instances are only allocated on the C
stack.

<dl>
<dt>
Files:
<dd>
<a href="../src/gsstruct.h">src/gsstruct.h</a>,
<a href="../src/gsstype.h">src/gsstype.h</a>.
</dl>

<h4><a name="Garbage_collection"></a>Garbage collection</h4>

<p>
The allocator architecture is designed to support compacting garbage
collection.  Every object must be able to enumerate all the pointers it
contains, both for tracing and for relocation.  As noted just above, the
structure descriptor provides procedures that do this.

<p>
Whether or not a particular allocator type actually provides a garbage
collector is up to the allocator: garbage collection is invoked through a
virtual procedure.  In practice, however, there are only two useful garbage
collectors for Ghostscript's own allocator:

<ul>
<li>The "real" garbage collector associated with the PostScript interpreter,
described <a href="#Interpreter_GC">below</a>;
<li>A "non" garbage collector that only merges adjacent free blocks.
</ul>

<p>
As noted above, because the architecture supports compacting garbage
collection, a "real" garbage collector cannot be run at arbitrary times,
because it cannot reliably find and relocate pointers that are on the C
stack.  In general, it is only safe to run a "real" garbage collector when
control is at the top level of the program, when there are no pointers to
garbage collectable objects from the stack (other than designated roots).

<dl>
<dt>
Files:
<dd>
<a href="../src/gsgc.h">src/gsgc.h</a>,
<a href="../src/gsnogc.c">src/gsnogc.c</a>,
<a href="../src/gsnogc.h">src/gsnogc.h</a>.
</dl>

<h4><a name="Movability"></a>Movability</h4>

<p>
As just noted, objects are normally movable by the garbage collector.
However, some objects must be immovable, usually because some other piece of
software must retain pointers to them.  The allocator API includes
procedures for allocating both movable (default) and immovable objects.
Note, however, that even immovable objects must be traceable (have a
structure descriptor), and may be freed, by the garbage collector.

<h4><a name="Parent_hierarchy"></a>Parent hierarchy</h4>

<p>
When an allocator needs to add memory to the pool that it manages, it
requests the memory from its <em>parent</em> allocator.  Every allocator has
a pointer to its parent; multiple allocators may share a single parent.  The
ultimate ancestor of all allocators that can expand their pool dynamically
is an allocator that calls <b><tt>malloc</tt></b>, described <a
href="#malloc">below</a>.  However, especially in embedded environments, an
allocator may be limited to a fixed-size pool assigned to it when it is
created.

<h4><a name="Allocator_API"></a>Allocator API</h4>

In summary, the allocator API provides the following principal operations:

<ul>
<li>Allocate and free movable (default) or immovable objects and strings.
<li>Return the structure type and size of an object.
<li>Resize (shrink or grow) movable objects and strings, preserving
the contents insofar as possible.
<li>Report the size of the managed pool, and how much of it is in use.
<li>Register and unregister root pointers for the garbage collector.
<li>Free the allocator itself.
<li>Consolidate adjacent free blocks to reduce fragmentation.
</ul>

<p>
For details, see <a href="../src/gsmemory.h">src/gsmemory.h</a>.

<p>
The allocator API also includes one special hook for the PostScript
interpreter: the concept of stable allocators.  See the section on <a
href="#save_forgetsave_restore"><b><tt>save</tt></b> and
<b><tt>restore</tt></b></a> below for details.

<dl>
<dt>
Files:
<dd>
<a href="../src/gsmemraw.h">src/gsmemraw.h</a>,
<a href="../src/gsmemory.c">src/gsmemory.c</a>,
<a href="../src/gsmemory.h">src/gsmemory.h</a>,
<a href="../src/gsstruct.h">src/gsstruct.h</a>,
<a href="../src/gsstype.h">src/gsstype.h</a>.
</dl>

<h3><a name="Freeing_storage"></a>Freeing storage</h3>

<p>
Ghostscript's memory management architecture provides three different ways
to free objects: explicitly, by reference counting, or by garbage
collection.  They provide different safety / performance / convenience
tradeoffs; we believe that all three are necessary.

<p>
Objects are always freed as a whole; strings may be freed piecemeal.

<p>
An object may have an associated finalization procedure, defined in the
structure descriptor.  This procedure is called just before the object is
freed, independent of which method is being used to free the object.  A few
types of objects have a virtual finalization procedure as well: the
finalization procedure defined in the descriptor simply calls the one in the
object.

<h4><a name="Explicit_freeing"></a>Explicit freeing</h4>

<p>
Objects and strings may be freed explicitly, using the
<b><tt>gs_free_</tt></b> virtual procedures in the allocator API.  It is up
to the client to ensure that all allocated objects are freed at most once,
and that there are no dangling pointers.

<p>
Explicit freeing is the fastest method, but is the least convenient and
least safe.  It is most appropriate when storage is freed in the same
procedure where it is allocated, or for storage that is known to be
referenced by only one pointer.

<h4><a name="Reference_counting"></a>Reference counting</h4>

<p>
Objects may be managed by reference counting.  When an object is allocated,
its reference count may be set to 0 or 1.  Subsequently, when the reference
count is decremented to 0, the object is freed.

<p>
The reference counting machinery provides its own virtual finalization
procedure for all reference-counted objects.  The machinery calls this
procedure when it is about to free the object (but not when the object is
freed in any other way, which is probably a design bug).  This is in
addition to (and called before) any finalization procedure associated with
the object type.

<p>
Reference counting is as fast as explicit freeing, but takes more space in
the object.  It is most appropriate for relatively large objects which are
referenced only from a small set of pointers.  Note that reference counting
cannot free objects that are involved in a pointer cycle (e.g., A -> B -> C
-> A).

<dl>
<dt>
Files:
<dd>
<a href="../src/gsrefct.h">src/gsrefct.h</a>.
</dl>

<h4><a name="Real_garbage_collection"></a>(Real) garbage collection</h4>

<p>
Objects and strings may be freed automatically by a garbage collector.  See
<a href="#Interpreter_GC">below</a>.

<h3><a name="Special_implementations"></a>Special implementations</h3>

<h4><a name="malloc"></a>malloc</h4>

<p>
As mentioned <a href="#Parent_hierarchy">above</a>, the ultimate ancestor of
all allocators with an expandable pool is one that calls
<b><tt>malloc</tt></b>.

<dl>
<dt>
Files:
<dd>
<a href="../src/gsmalloc.h">src/gsmalloc.h</a>,
<a href="../src/gsmalloc.c">src/gsmalloc.c</a>.
</dl>

<h4><a name="Locking"></a>Locking</h4>

<p>
In a multi-threaded environment, if an allocator must be callable from
multiple threads (for example, if it is used to allocate structures in one
thread that are passed to, and freed by, another thread), the allocator must
provide mutex protection.  Ghostscript provides this capability in the form
of a <em>wrapper</em> allocator, that simply forwards all calls to a
<em>target</em> allocator under protection of a mutex.  Using the wrapper
technique, any allocator can be made thread-safe.

<dl>
<dt>
Files:
<dd>
<a href="../src/gsmemlok.h">src/gsmemlok.h</a>,
<a href="../src/gsmemlok.c">src/gsmemlok.c</a>.
</dl>

<h4><a name="Retrying"></a>Retrying</h4>

<p>
In an embedded environment, job failure due to memory exhaustion is very
undesirable.  Ghostscript provides a wrapper allocator that, when an
allocation attempt fails, calls a client-provided procedure that can attempt
to free memory, then ask for the original allocation to be retried.  For
example, such a procedure can wait for a queue to empty, or can free memory
occupied by caches.

<dl>
<dt>
Files:
<dd>
<a href="../src/gsmemret.h">src/gsmemret.h</a>,
<a href="../src/gsmemret.c">src/gsmemret.c</a>.
</dl>

<h3><a name="Standard_implementation"></a>Standard implementation</h3>

<p>
The standard Ghostscript allocator gets storage from its parent (normally
the <b><tt>malloc</tt></b> allocator) in large blocks called
<em>chunks</em>, and then allocates objects up from the low end and strings
down from the high end.  Large objects or strings are allocated in their own
chunk.

<p>
The standard allocator maintains a set of free-block lists for small object
sizes, one list per size (rounded up to the word size), plus a free-block
list for large objects (but not for objects so large that they get their own
chunk: when such an object is freed, its chunk is returned to the parent).
The lists are not sorted; adjacent blocks are only merged if needed.

<p>
While the standard allocator implements the generic allocator API, and is
usable with the library alone, it includes a special hook for the PostScript
interpreter to aid in the efficient allocation of PostScript composite
objects (arrays and dictionaries).  See the section on <a
href="#Refs">Refs</a> below for details.

<dl>
<dt>
Files:
<dd>
<a href="../src/gsalloc.c">src/gsalloc.c</a>,
<a href="../src/gsalloc.h">src/gsalloc.h</a>,
<a href="../src/gxalloc.h">src/gxalloc.h</a>,
<a href="../src/gxobj.h">src/gxobj.h</a>.
</dl>

<h3><a name="PostScript_interpreter_extensions"></a>PostScript interpreter extensions</h3>

<p>
The PostScript interpreter uses an allocator that extends the graphic
library's standard allocator to handle PostScript objects,
<b><tt>save</tt></b> and <b><tt>restore</tt></b>, and real garbage
collection.

<h4><a name="Refs"></a>Refs (PostScript "objects")</h4>

<p>
Ghostscript represents what the PLRM calls PostScript "objects" using a
structure called a <b><tt>ref</tt></b>, defined in <a
href="../src/iref.h">src/iref.h</a>; packed refs, used for the elements of
packed arrays, are defined in <a href="../src/ipacked.h">src/ipacked.h</a>.
See those files for detailed information.

<dl>
<dt>
Files:
<dd>
<a href="../src/ipacked.h">src/ipacked.h</a>,
<a href="../src/iref.h">src/iref.h</a>.
</dl>

<p>
The PLRM calls for two types of "virtual memory" (VM) space: global and
local.  Ghostscript adds a third space, <em>system</em> VM, whose lifetime
is an entire session -- i.e., it is effectively "permanent".  All three
spaces are subject to garbage collection.  There is a separate allocator
instance for each VM space (actually, two instances each for global and
local spaces; see <a href="#save_forgetsave_restore">below</a>).  In a
system with multiple contexts and multiple global or local VMs, each global
or local VM has its own allocator instance(s).

<p>
Refs that represent PostScript composite objects, and therefore include
pointers to stored data, include a 2-bit VM space tag to indicate in which
VM the object data are stored.  In addition to system, global, and local VM,
there is a tag for "foreign" VM, which means that the memory is not managed
by a Ghostscript allocator at all.  Every store into a composite object must
check for <b><tt>invalidaccess</tt></b>: the VM space tag values are chosen
to help make this check efficient.  See <a
href="../src/ivmspace.h">src/ivmspace.h</a>, <a
href="../src/iref.h">src/iref.h</a>, and <a
href="../src/store.h">src/store.h</a> for details.

<dl>
<dt>
Files:
<dd>
<a href="../src/ivmspace.h">src/ivmspace.h</a>.
</dl>

<p>
PostScript composite objects (arrays and dictionaries) are usually small.
Using a separate memory manager object for each composite object would waste
a lot of space for object headers.  Therefore, the interpreter's memory
manager packs multiple composite objects (also called "ref-containing
objects") into a single memory manager object, similar to the way the memory
manager packs multiple objects into a chunk (see <a
href="#Standard_implementation">above</a>).  See <a
href="../src/gxalloc.h">src/gxalloc.h</a> for details.  This memory manager
object has a structure descriptor, like all other memory manager objects.

<p>
Note that the <b><tt>value.pdict</tt></b>, <b><tt>value.refs</tt></b>, or
<b><tt>value.packed</tt></b> member of a ref must point to a PostScript
composite object, and therefore can point into the middle of a memory
manager object.  This requires special handling by the garbage collector (<a
href="#Interpreter_GC">q.v.</a>).

<dl>
<dt>
Files:
<dd>
<a href="../src/ialloc.c">src/ialloc.c</a>,
<a href="../src/ialloc.h">src/ialloc.h</a>,
<a href="../src/iastate.h">src/iastate.h</a>,
<a href="../src/iastruct.h">src/iastruct.h</a>,
<a href="../src/ilocate.c">src/ilocate.c</a>,
<a href="../src/imemory.h">src/imemory.h</a>,
<a href="../src/istruct.h">src/istruct.h</a>.
</dl>

<h4><a name="save_forgetsave_restore"></a>save/.forgetsave/restore</h4>

<p>
In addition to <b><tt>save</tt></b> and <b><tt>restore</tt></b>, Ghostscript
provides a <b><tt>.forgetsave</tt></b> operator that makes things as though
a given <b><tt>save</tt></b> had never happened.  (In data base terminology,
<b><tt>save</tt></b> is "begin transaction", <b><tt>restore</tt></b> is
"abort transaction", and <b><tt>.forgetsave</tt></b> is "end/commit
transaction").  <b><tt>.forgetsave</tt></b> was implemented for a specific
commercial customer (who may no longer even be using it): it was a pain to
make work, but it's in the code now, and should be maintained.  See the
extensive comments in <a href="../src/isave.c">src/isave.c</a> for more
information about how these operations work.

<dl>
<dt>
Files:
<dd>
<a href="../src/idosave.h">src/idosave.h</a>,
<a href="../src/isave.c">src/isave.c</a>,
<a href="../src/isave.h">src/isave.h</a>,
<a href="../src/isstate.h">src/isstate.h</a>,
<a href="../src/store.h">src/store.h</a>.
</dl>

<h4><a name="Stable_allocators"></a>Stable allocators</h4>

<p>
Even though <b><tt>save</tt></b> and <b><tt>restore</tt></b> are concepts
from the PostScript interpreter, the generic allocator architecture and API
include a feature to support them, called <em>stable</em> allocators.  Every
allocator has an associated stable allocator, which tags pointers with the
same VM space number but which is not subject to <b><tt>save</tt></b> and
<b><tt>restore</tt></b>.  System VM is intrinsically stable (its associated
stable allocator is the same allocator), so there are only 5 allocators in
ordinary single-context usage: system VM, stable global VM, ordinary global
VM, stable local VM, ordinary local VM.

<p>
The reason that we cannot simply allocate all stable objects in system VM is
that their refs must still be tagged with the correct VM space number, so
that the check against storing pointers from global VM to local VM can be
enforced properly.

<p>
All PostScript objects are normally allocated with the non-stable
allocators.  The stable allocators should be used with care, since using
them can easily create dangling pointers: if storage allocated with a stable
allocator contains any references to PostScript objects, the client is
responsible for ensuring that the references don't outlive the referenced
objects, normally by ensuring that any such referenced objects are allocated
at the outermost <b><tt>save</tt></b> level.

<p>
The original reason for wanting stable allocators was the PostScript stacks,
which are essentially PostScript arrays but are not subject to
<b><tt>save</tt></b> and <b><tt>restore</tt></b>.  Some other uses of stable
allocators are:

<ul>

<li>Several per-context structures for DPS.

<li>Paths (see <b><tt>gstate_path_memory</tt></b> in
<a href="../src/gsstate.c">src/gsstate.c</a>.

<li>Row buffers for images (see <b><tt>gs_image_row_memory</tt></b> in <a
href="../src/gsimage.c">src/gsimage.c</a>), because the data-reading
procedure for an image can invoke <b><tt>save</tt></b> and
<b><tt>restore</tt></b>.

<li>Notification lists for fonts, to handle the sequence allocate .. save
.. register .. restore.

<li>The parameter lists for pdfwrite and pswrite devices (in <a
href="../src/gdevpsdp.c">src/gdevpsdp.c</a>), because the whole issue of
local vs. global VM for setpagedevice is, in the words of Ed Taft of Adobe,
"a mess".

<li>Many places in the pdfwrite driver, because many of its bookkeeping
structures must not be restorable.

</ul>

<p>
For more specific examples, search the sources for references to
<b><tt>gs_memory_stable</tt></b>.

<h4><a name="Interpreter_GC"></a>Garbage collection</h4>

<p>
The interpreter's garbage collector is a compacting, non-conservative,
mark-and-sweep collector.

<ul>
<li>It compacts storage because that is the only way to avoid permanent
sandbars, which is essential in limited-memory environments.
<li>It is non-conservative because conservative collectors (which attempt
to determine whether arbitrary bit patterns are pointers) cannot compact.
<li>It uses mark-and-sweep, rather than a more modern copying approach,
because it cannot afford the extra memory required for copying.
</ul>

<p>
Because the garbage collector is non-conservative, it cannot be run if there
are any pointers to movable storage from the C stack.  Thus it cannot be run
automatically when the allocator is unable to allocate requested space.
Instead, when the allocator has allocated a given amount of storage (the
<b><tt>vm_threshold</tt></b> amount, corresponding to the PostScript
<b><tt>VMThreshold</tt></b> parameter), it sets a flag that the interpreter
checks in the main loop.  When the interpreter sees that this flag is set,
it calls the garbage collector: at that point, there are no problematic
pointers from the stack.

<p>
Roots for tracing must be registered with the allocator.  Most roots are
registered during initialization.

<p>
"Mark-and-sweep" is a bit of a misnomer.  The garbage collector actually has
5 main phases:

<ul>
<li>Sweep to clear marks;
<li>Trace and mark;
<li>Sweep to compute relocation;
<li>Sweep to relocate pointers;
<li>Sweep and compact.
</ul>

<p>
There is some extra complexity to handle collecting local VM only.  In this
case, all pointers in global VM are treated as roots, and global VM is not
compacted.

<p>
As noted above, PostScript arrays and strings can have refs that point
within them (because of <b><tt>getinterval</tt></b>).  Thus the garbage
collector must mark each element of an array, and even each byte of a
string, individually.  Specifically, it marks objects, refs, and strings
using 3 different mechanisms:

<ul>

<li>Objects have a mark bit in their header: see
<a href="../src/gxobj.h">src/gxobj.h</a>,

<li>Refs and packed refs have a reserved mark bit: see <a
href="../src/iref.h">src/iref.h</a> and <a
href="../src/ipacked.h">src/ipacked.h</a>.

<li>Strings use a separate bit table, with one bit per string byte: see
<a href="../src/gxalloc.h">src/gxalloc.h</a>,

</ul>

<p>
Similarly, it records the relocation information for objects, refs, and
strings differently:

<ul>

<li>Objects record relocation in the object header.

<li>Refs record relocation in unused fields of refs such as nulls that
don't use their <b><tt>value</tt></b> field.  Every memory manager object
that stores ref-containing objects as described above has an extra, unused
ref at the end for this purpose.

<li>Strings use a separate relocation table.

</ul>

<dl>
<dt>
Files:
<dd>
<a href="../src/igc.c">src/igc.c</a>,
<a href="../src/igc.h">src/igc.h</a>,
<a href="../src/igcref.c">src/igcref.c</a>,
<a href="../src/igcstr.c">src/igcstr.c</a>,
<a href="../src/igcstr.h">src/igcstr.h</a>,
<a href="../src/ireclaim.c">src/ireclaim.c</a>.
</dl>

<hr>

<h2><a name="Portability"></a>Portability</h2>

<p>
One of Ghostscript's most important features is its great portability across
platforms (CPUs, operating systems, compilers, and build tools).  The code
supports portability through two mechanisms:

<ul>

<li><a href="#Structural">Structural mechanisms</a> -- segregating
platform-dependent information into files in a particular way.

<li><a href="#Coding">Coding standards</a> -- avoiding relying on byte
order, scalar size, and platform-specific compiler or library features.

</ul>

<h3><a name="Structural"></a>Structural</h3>

<h4><a name="CPU_and_compiler"></a>CPU and compiler</h4>

<p>
Ghostscript attempts to discover characteristics of the CPU and compiler
automatically during the build process, by compiling and then executing a
program called <b><tt>genarch</tt></b>.  <b><tt>genarch</tt></b> generates a
file <b><tt>obj/arch.h</tt></b>, which almost all Ghostscript files then
include.  This works well for things like word size, byte order, and
floating point representation, but it can't determine whether or not a
compiler supports a particular feature, because if a feature is absent, the
compilation may fail.

<dl>
<dt>
Files:
<dd>
<a href="../src/genarch.c">src/genarch.c</a>,
<a href="../obj/arch.h">obj/arch.h</a>.
</dl>

<h4><a name="Library_headers"></a>Library headers</h4>

<p>
Despite the supposed standardization of ANSI C, platforms vary considerably
in where (and whether) they provide various standard library facilities.
Currently, Ghostscript's build process doesn't attempt to sort this out
automatically.  Instead, for each library header file
<b><tt>&lt;</tt></b><em>xxx</em><b><tt>.h&gt;</tt></b> there is a
corresponding Ghostscript source file
<b><tt>src/</tt></b><em>xxx</em><b><tt>_.h</tt></b>, containing a set of
compile-time conditionals that attempt to select the correct platform header
file, or in some cases substitute Ghostscript's own code for a missing
facility.  You may need to edit these files when moving to platforms with
unusually non-standard libraries.

<dl>
<dt>
Files:
<dd>
<a href="../src/ctype_.h">src/ctype_.h</a>,
<a href="../src/dirent_.h">src/dirent_.h</a>,
<a href="../src/dos_.h">src/dos_.h</a>,
<a href="../src/errno_.h">src/errno_.h</a>,
<a href="../src/fcntl_.h">src/fcntl_.h</a>,
<a href="../src/jerror_.h">src/jerror_.h</a>,
<a href="../src/malloc_.h">src/malloc_.h</a>,
<a href="../src/math_.h">src/math_.h</a>,
<a href="../src/memory_.h">src/memory_.h</a>,
<a href="../src/pipe_.h">src/pipe_.h</a>,
<a href="../src/png_.h">src/png_.h</a>,
<a href="../src/stat_.h">src/stat_.h</a>,
<a href="../src/stdio_.h">src/stdio_.h</a>,
<a href="../src/string_.h">src/string_.h</a>,
<a href="../src/time_.h">src/time_.h</a>,
<a href="../src/unistd_.h">src/unistd_.h</a>,
<a href="../src/vmsmath.h">src/vmsmath.h</a>,
<a href="../src/windows_.h">src/windows_.h</a>,
<a href="../src/x_.h">src/x_.h</a>.
</dl>

<p>
It has been suggested that the GNU <b><tt>configure</tt></b> scripts do the
above better, for Unix systems, than Ghostscript's current methods.  While
this may be true, we have found <b><tt>configure</tt></b> scripts difficult
to write, understand, and maintain; and the <b><tt>autoconf</tt></b> tool
for generating <b><tt>configure</tt></b> scripts, which we found easy to
use, doesn't cover much of the ground that Ghostscript requires.

<h4><a name="Cross_platform_APIs"></a>Cross-platform APIs</h4>

<p>
For a few library facilities that are available on all platforms but are not
well standardized, or that may need to be changed for special environments,
Ghostscript defines its own APIs.  It is an architectural property of
Ghostscript that the implementations of these APIs are the only .c files for
which the choice of platform (as opposed to choices of drivers or optional
features) determines whether they are compiled and linked into an
executable.

<dl>

<dt>
API:
<dd>
<a href="../src/gp.h">src/gp.h</a>,
<a href="../src/gpcheck.h">src/gpcheck.h</a>,
<a href="../src/gpgetenv.h">src/gpgetenv.h</a>,
<a href="../src/gpmisc.h">src/gpmisc.h</a>,
<a href="../src/gpsync.h">src/gpsync.h</a>.

<dt>
Implementation files shared among multiple platforms:
<dd>
<a href="../src/gp_getnv.c">src/gp_getnv.c</a>,
<a href="../src/gp_mktmp.c">src/gp_mktmp.c</a>,
<a href="../src/gp_nsync.c">src/gp_nsync.c</a>,
<a href="../src/gp_psync.c">src/gp_psync.c</a>,
<a href="../src/gp_strdl.c">src/gp_strdl.c</a>,
<a href="../src/gpmisc.c">src/gpmisc.c</a>.

<dt>
Platform-specific implementation files:
<dd>
<a href="../src/gp_dosfe.c">src/gp_dosfe.c</a>,
<a href="../src/gp_dosfs.c">src/gp_dosfs.c</a>,
<a href="../src/gp_dvx.c">src/gp_dvx.c</a>,
<a href="../src/gp_iwatc.c">src/gp_iwatc.c</a>,
<a href="../src/gp_msdos.c">src/gp_msdos.c</a>,
<a href="../src/gp_mshdl.c">src/gp_mshdl.c</a>,
<a href="../src/gp_msio.c">src/gp_msio.c</a>,
<a href="../src/gp_mslib.c">src/gp_mslib.c</a>,
<a href="../src/gp_mswin.c">src/gp_mswin.c</a>,
<a href="../src/gp_mswin.h">src/gp_mswin.h</a>,
<a href="../src/gp_ntfs.c">src/gp_ntfs.c</a>,
<a href="../src/gp_os2.c">src/gp_os2.c</a>,
<a href="../src/gp_os9.c">src/gp_os9.c</a>,
<a href="../src/gp_stdia.c">src/gp_stdia.c</a>,
<a href="../src/gp_stdin.c">src/gp_stdin.c</a>,
<a href="../src/gp_sysv.c">src/gp_sysv.c</a>,
<a href="../src/gp_unifn.c">src/gp_unifn.c</a>,
<a href="../src/gp_unifs.c">src/gp_unifs.c</a>,
<a href="../src/gp_unix.c">src/gp_unix.c</a>,
<a href="../src/gp_vms.c">src/gp_vms.c</a>,
<a href="../src/gp_wgetv.c">src/gp_wgetv.c</a>,
<a href="../src/gp_win32.c">src/gp_win32.c</a>,
<a href="../src/gp_wsync.c">src/gp_wsync.c</a>.

</dl>

<h4><a name="Makefiles"></a>Makefiles</h4>

<p>
For information on the structure and conventions used within makefiles, see
the <a href="#Makefile_structure">Makefile structure</a> section above.

<p>
Ghostscript's makefiles are structured very similarly to the cross-platform
library files.  The great majority of the makefiles are portable across all
platforms and all versions of <b><tt>make</tt></b>.  To achieve this, the
platform-independent makefiles must obey two constraints beyond those of the
POSIX <b><tt>make</tt></b> program:

<ul>

<li>No conditionals or <b><tt>include</tt></b>s are allowed.  While most
<b><tt>make</tt></b> programs now provide some form of conditional execution
and some form of inclusion, there is no agreement on the syntax.
(Conditionals and includes are allowed in platform-dependent makefiles; in
fact, an inclusion facility is required.)

<li>There must be a space on both sides of the : that separates the target
of a rule from its dependencies.  This is required for compatibility with
the OpenVMS <b><tt>MMS</tt></b> and <b><tt>MMK</tt></b> programs.

</ul>

<p>
The top-level makefile for each platform (where "platform" includes the OS,
the compiler, and the flavor of <b><tt>make</tt></b>) contains all the build
options, plus <b><tt>include</tt></b>s for the generic makefiles and any
platform-dependent makefiles that are shared among multiple platforms.

<p>
While most of the top-level makefiles build a PostScript and/or PDF
interpreter configuration, there are also a few makefiles that build a test
program that only uses the graphics library without any language
interpreter.  Among other things, this can be helpful in verifying that no
accidental dependencies on the interpreter have crept into the library or
drivers.

<p>
For families of similar platforms, the question arises whether to use
multiple top-level makefiles, or whether to use a single top-level makefile
that may require minor editing for some (or all) platforms.  Ghostscript
currently uses the following top-level makefiles for building interpreter
configurations:

<ul>

<li>POSIX systems (inluding Linux and Unix):
<ul>
<li><a href="../src/configure.ac">src/configure.ac</a>,
GNU Autoconf source script for automatic build configuration.
<li><a href="../src/Makefile.in">src/Makefile.in</a>,
source for the top-level makefile used in the Autoconf build.
<li><a href="../src/unix-gcc.mak">src/unix-gcc.mak</a>,
for Unix with gcc.
<li><a href="../src/unixansi.mak">src/unixansi.mak</a>,
for Unix with an ANSI C compiler other than gcc.
</ul>

<li>PC:
<ul>
<li><a href="../src/bcwin32.mak">src/bcwin32.mak</a>,
for MS Windows with Borland C++ Builder.
<li><a href="../src/msvc32.mak">src/msvc32.mak</a>,
for MS Windows with Microsoft Visual C (MSVC).
<li><a href="../src/os2.mak">src/os2.mak</a>,
for MS-DOS or OS/2 GCC/EMX environment.
<li><a href="../src/watcw32.mak">src/watcw32.mak</a>,
for MS Windows with Watcom C.
</ul>

<li>Macintosh:
<ul>
<li><a href="../src/macosx.mak">src/macosx.mak</a>,
commandline makefile for MacOS X.
<li><a href="../src/macos-mcp.mak">src/macos-mcp.mak</a>,
dummy makefile to generate an xml project file for Metrowerks Codewarrior.
</ul>


<li>Other:
<ul>
<li><a href="../src/all-arch.mak">src/all-arch.mak</a>,
for building on many Unix systems in a networked test environment.
<li><a href="../src/dvx-gcc.mak">src/dvx-gcc.mak</a>,
for DesqView/X with gcc.
<li><a href="../src/openvms.mak">src/openvms.mak</a>,
for OpenVMS with Digital's CC compiler and the MMS build program.
<li><a href="../src/openvms.mmk">src/openvms.mmk</a>,
for OpenVMS with Digital's CC compiler and the MMK build program.
</ul>

</ul>

<p>
The following top-level makefiles build the library test program:

<ul>
<li><a href="../src/ugcclib.mak">src/ugcclib.mak</a>,
on Unix with gcc.
<li><a href="../src/msvclib.mak">src/msvclib.mak</a>,
on MS Windows with MSVC.
<li><a href="../src/watclib.mak">src/watclib.mak</a>,
on extended MS-DOS with Watcom C.
</ul>

<p>
The MSVC makefiles may require editing to select between different versions
of MSVC, since different versions may have slightly incompatible command
line switches or customary installation path names.  The Unix makefiles
often require editing to deal with differing library path names and/or
library names.  For details, see <a href="Make.htm#Unix_build">the Unix
section</a> of the documentation for building Ghostscript.

<dl>

<dt>
Library test program:
<dd>
<a href="../src/gslib.c">src/gslib.c</a>.

<dt>
Platform-independent makefiles:
<dd>

<dl>

<dt>
Graphics library and support:
<dd>
<a href="../src/contrib.mak">src/contrib.mak</a>,
<a href="../src/devs.mak">src/devs.mak</a>,
<a href="../src/gs.mak">src/gs.mak</a>,
<a href="../src/lib.mak">src/lib.mak</a>,
<a href="../src/version.mak">src/version.mak</a>.

<dt>
PostScript interpreter and fonts:
<dd>
<a href="../src/cfonts.mak">src/cfonts.mak</a>,
<a href="../src/int.mak">src/int.mak</a>,
<a href="../src/wmin.mak">src/wmin.mak</a>.

<dt>
Third-party libraries:
<dd>
<a href="../src/icclib.mak">src/icclib.mak</a>,
<a href="../src/ijs.mak">src/ijs.mak</a>,
<a href="../src/jbig2.mak">src/jbig2.mak</a>,
<a href="../src/jpeg.mak">src/jpeg.mak</a>,
<a href="../src/libpng.mak">src/libpng.mak</a>,
<a href="../src/zlib.mak">src/zlib.mak</a>.

</dl>

<dt>
Shared platform-dependent makefiles:
<dd>

<dl>

<dt>
Unix:
<dd>
<a href="../src/unix-aux.mak">src/unix-aux.mak</a>,
<a href="../src/unix-dll.mak">src/unix-dll.mak</a>,
<a href="../src/unix-end.mak">src/unix-end.mak</a>,
<a href="../src/unixhead.mak">src/unixhead.mak</a>,
<a href="../src/unixinst.mak">src/unixinst.mak</a>,
<a href="../src/unixlink.mak">src/unixlink.mak</a>.

<dt>
Microsoft Windows and MS-DOS:
<dd>
<a href="../src/msvccmd.mak">src/msvccmd.mak</a>,
<a href="../src/msvctail.mak">src/msvctail.mak</a>,
<a href="../src/pcwin.mak">src/pcwin.mak</a>,
<a href="../src/wccommon.mak">src/wccommon.mak</a>,
<a href="../src/wctail.mak">src/wctail.mak</a>,
<a href="../src/winint.mak">src/winint.mak</a>,
<a href="../src/winlib.mak">src/winlib.mak</a>,
<a href="../src/winplat.mak">src/winplat.mak</a>.

<dt>
Other:
<dd>
<a href="../src/dvx-head.mak">src/dvx-head.mak</a>,
<a href="../src/dvx-tail.mak">src/dvx-tail.mak</a>.<br>
<a href="../src/macos-fw.mak">src/macos-fw.mak</a>,
for building as a MacOS X Framework.

</dl>

</dl>

<h3><a name="Coding"></a>Coding</h3>

<p>
Coding for portability requires avoiding both <em>explicit</em>
dependencies, such as platform-dependent <b><tt>#ifdef</tt></b>s, and
<em>implicit</em> dependencies, such as dependencies on byte order or the
size of the integral types.

<h4><a name="Explicit_dependencies"></a>Explicit dependencies</h4>

<p>
The platform-independent .c files never, ever, use <b><tt>#ifdef</tt></b> or
<b><tt>#if</tt></b> to select code for specific platforms.  Instead, we
always try to characterize some abstract property that is being tested.  For
example, rather than checking for macros that are defined on those specific
platforms that have 64-bit <b><tt>long</tt></b> values, we define a macro
<b><tt>ARCH_SIZEOF_LONG</tt></b> that can then be tested.  Such macros are
always defined in a .h file, either automatically in <b><tt>arch.h</tt></b>,
or explicitly in a <em>xxx</em><b><tt>_.h</tt></b> file, as described in
earlier sections.

<dl>
<dt>
Files:
<dd>
<a href="../src/std.h">src/std.h</a>,
<a href="../src/stdpn.h">src/stdpn.h</a>,
<a href="../src/stdpre.h">src/stdpre.h</a>.
</dl>

<h4><a name="Implicit_dependencies"></a>Implicit dependencies</h4>

<p>
The most common source of byte ordering dependencies is casting between
types (T1 *) and (T2 *) where T1 and T2 are numeric types that aren't merely
signed/unsigned variants of each other.  To avoid this, the only casts
allowed in the code are between numeric types, from a pointer type to a long
integral type, and between pointer types.

<p>
Ghostscript's code assumes the following about the sizes of various types:

<dl>
<dt>char<dd>8 bits
<dt>short<dd>16 bits
<dt>int<dd>32 or 64 bits
<dt>long<dd>32 or 64 bits
<dt>float<dd>32 bits (may work with 64 bits)
<dt>double<dd>64 bits (may work with 128 bits)
</dl>

<p>
The code does not assume that the <b><tt>char</tt></b> type is signed (or
unsigned); except for places where the value is always a literal string, or
for interfacing to library procedures, the code uses <b><tt>byte</tt></b> (a
Ghostscript synonym for <b><tt>unsigned char</tt></b>) almost everywhere.

<p>
Pointers are signed on some platforms and unsigned on others.  In the few
places in the memory manager where it's necessary to reliably order-compare
(as opposed to equality-compare) pointers that aren't known to point to the
same allocated block of memory, the code uses the
<b><tt>PTR_</tt></b><em>relation</em> macros rather than direct comparisons.

<p>
See the files listed above for other situations where a macro provides
platform-independence or a workaround for bugs in specific compilers or
libraries (of which there are a distressing number).

<h4><a name="Platform_specific_code"></a>Platform-specific code</h4>

<p>
There are some features that are inherently platform-specific:

<ul>

<li>Microsoft Windows requires a lot of special top-level code, and also has
an installer and uninstaller.

<li>OS/2 requires a little special code.

<li>MacOS also requires special top-level code (now distributed with the
standard Ghostscript package).

<li>All platforms supporting DLLs (currently all three of the above) share
some special top-level code.

</ul>

<dl>

<dt>
MS Windows files:
<dd>
<a href="../src/dpmain.c">src/dpmain.c</a>,
<a href="../src/dwdll.c">src/dwdll.c</a>,
<a href="../src/dwdll.h">src/dwdll.h</a>,
<a href="../src/dwimg.c">src/dwimg.c</a>,
<a href="../src/dwimg.h">src/dwimg.h</a>,
<a href="../src/dwinst.cpp">src/dwinst.cpp</a>,
<a href="../src/dwinst.h">src/dwinst.h</a>,
<a href="../src/dwmain.c">src/dwmain.c</a>,
<a href="../src/dwmain.h">src/dwmain.h</a>,
<a href="../src/dwmainc.c">src/dwmainc.c</a>,
<a href="../src/dwnodll.c">src/dwnodll.c</a>,
<a href="../src/dwreg.c">src/dwreg.c</a>,
<a href="../src/dwreg.h">src/dwreg.h</a>,
<a href="../src/dwsetup.cpp">src/dwsetup.cpp</a>,
<a href="../src/dwsetup.h">src/dwsetup.h</a>,
<a href="../src/dwtext.c">src/dwtext.c</a>,
<a href="../src/dwtext.h">src/dwtext.h</a>,
<a href="../src/dwtrace.c">src/dwtrace.c</a>,
<a href="../src/dwtrace.h">src/dwtrace.h</a>,
<a href="../src/dwuninst.cpp">src/dwuninst.cpp</a>,
<a href="../src/dwuninst.h">src/dwuninst.h</a>,
<a href="../src/gp_msdll.c">src/gp_msdll.c</a>,
<a href="../src/gp_mspol.c">src/gp_mspol.c</a>,
<a href="../src/gp_msprn.c">src/gp_msprn.c</a>,
<a href="../src/gs16spl.c">src/gs16spl.c</a>,
<a href="../src/gsdllwin.h">src/gsdllwin.h</a>.

<dt>
OS/2 files:
<dd>
<a href="../src/gsdllos2.h">src/gsdllos2.h</a>.

<dt>
Unix files:
<dd>
<a href="../src/dxmain.c">src/dxmain.c</a>,
<a href="../src/dxmainc.c">src/dxmainc.c</a>.

<dt>
Macintosh files:
<dd>
<a href="../src/gdevmac.c">src/gdevmac.c</a>,
<a href="../src/gdevmac.h">src/gdevmac.h</a>,
<a href="../src/gdevmacpictop.h">src/gdevmacpictop.h</a>,
<a href="../src/gdevmacttf.h">src/gdevmacttf.h</a>,
<a href="../src/gdevmacxf.c">src/gdevmacxf.c</a>,
<a href="../src/gp_mac.c">src/gp_mac.c</a>,
<a href="../src/gp_mac.h">src/gp_mac.h</a>,
<a href="../src/gp_macio.c">src/gp_macio.c</a>,
<a href="../src/gp_macpoll.c">src/gp_macpoll.c</a>,
<a href="../src/gsiomacres.c">src/gsiomacres.c</a>,
<a href="../src/macgenmcpxml.sh">src/macgenmcpxml.sh</a>,
<a href="../src/macsystypes.h">src/macsystypes.h</a>,
<a href="../src/macos_carbon_pre.h">src/macos_carbon_pre.h</a>,
<a href="../src/macos_carbon_d_pre.h">src/macos_carbon_d_pre.h</a>,
<a href="../src/macos_classic_d_pre.h">src/macos_classic_d_pre.h</a>,

<a href="../src/dmmain.c">src/dmmain.c</a>,
<a href="../src/dmmain.r">src/dmmain.r</a>.

<dt>
VMS files:
<dd>
<a href="../src/vms_x_fix.h">src/vms_x_fix.h</a>.

<dt>
DLL files:
<dd>
<a href="../src/gsdll.c">src/gsdll.c</a>,
<a href="../src/gsdll.h">src/gsdll.h</a>,
<a href="../src/gdevdsp.c">src/gdevdsp.c</a>,
<a href="../src/gdevdsp.h">src/gdevdsp.h</a>,
<a href="../src/gdevdsp2.h">src/gdevdsp2.h</a>,
<a href="../src/iapi.c">src/iapi.c</a>,
<a href="../src/iapi.h">src/iapi.h</a>,
<a href="../src/idisp.c">src/idisp.c</a>,
<a href="../src/idisp.h">src/idisp.h</a>.
<p>
The new DLL interface (new as of 7.0) is especially useful with the
new display device, so it is included here. Both are due to Russell
Lang.

</dl>


<hr>

<h2><a name="Adding_features_and_options"></a>Adding features and options</h2>

<p>
[Ray, please supply more information about what you want here]

<h2><a name="Troubleshooting"></a>Troubleshooting</h2>

<p>
The Ghostscript code has many tracing and debugging features that can be
enabled at run time using the <b><tt>-Z</tt></b> command line switch, if the
executable was compiled with <b><tt>DEBUG</tt></b> defined.  One
particularly useful combination is <b><tt>-Z@\?</tt></b>, which fills free
memory blocks with a pattern and also turns on run-time memory consistency
checking.  For more information, see <a
href="Use.htm#Debugging">doc/Use.htm#Debugging</a>; you can also search for
occurrences of <b><tt>if_debug</tt></b> or <b><tt>gs_debug_c</tt></b> in the
source code.  Note that many of these features are in the graphics library
and do not require a PostScript interpreter.

<p>
The code also contains many run-time procedures whose only purpose is to be
called from the debugger to print out various data structures, including all
the procedures in <a href="../src/idebug.c">src/idebug.c</a> (for the
PostScript interpreter) and the <b><tt>debug_dump_</tt></b> procedures in <a
href="../src/gsmisc.c">src/gsmisc.c</a>.

<dl>
<dt>
Files:
<dd>
<a href="Use.htm#Debugging">doc/Use.htm#Debugging</a>,
<a href="../src/gdebug.h">src/gdebug.h</a>,
<a href="../src/gsmdebug.h">src/gsmdebug.h</a>,
<a href="../src/idebug.h">src/idebug.h</a>,
<a href="../src/idebug.c">src/idebug.c</a>.
</dl>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 2001 artofcode LLC.
All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</small></body>
</html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Details of Ghostscript output devices</title>
<!-- $Id: Devices.htm,v 1.72 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: devices.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>Details of Ghostscript output devices</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Measurements">Notes on measurements</a>
<li><a href="#File_formats">Image file formats</a>
<ul>
<li><a href="#PNG">PNG file format</a>
<li><a href="#JFIF">JPEG file format (JFIF)</a>
<li><a href="#PNM">PNM file format</a>
<li><a href="#TIFF">TIFF file formats</a>
<li><a href="#fax">fax file formats</a>
<li><a href="#BMP">BMP file format</a>
<li><a href="#PCX">PCX file format</a>
<li><a href="#PSD">PSD file format (DeviceN color model)</a>
</ul>
<li><a href="#High-level">High level formats</a>
<ul>
<li><a href="#PDF">PDF file output</a>
<li><a href="#PS">PostScript file output</a>
<li><a href="#EPS">EPS file output</a>
<li><a href="#PXL">PCL-XL file output</a>
<li><a href="#Unicode">Unicode support for high level devices</a>
</ul>
<li><a href="#Display_devices">Display devices</a>
<ul>
<li><a href="#x11_devices">X Window System</a>
</ul>
<li><a href="#IJS">IJS - Inkjet and other raster devices</a>
<li><a href="#HP_ijs">HP Deskjet official drivers</a>
<li><a href="#gimp-print">Gimp-Print driver collection</a>
<li><a href="#Win">MS Windows printers</a>
<li><a href="#SPARCprinter">Sun SPARCprinter</a>
<ul>
<li><a href="#SPARC_install">Installation</a>
<li><a href="#SPARC_problems">Problems</a>
</ul>
<li><a href="#Apple">Apple dot matrix printer</a>
<li><a href="#Test">Test devices</a>
<ul>
<li><a href="#Permute">Permutation (DeviceN color model)</a>
<li><a href="#SPOT">spotcmyk (DeviceN color model)</a> 
<li><a href="#XCF">XCF (DeviceN color model)</a>
<li><a href="#bitraw">Raw 'bit' devices</a>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.  You may also be interested in <a href="Make.htm">how to
build Ghostscript</a> and <a href="Install.htm">install it</a>, as well as
the description of the <a href="Drivers.htm">driver interface</a>.

<p>Documentation for some older, superceded devices has been moved to
<a href="Deprecated.htm">another document</a>. In general such devices are deprecated
and will be removed in future versions of Ghostscript. In general all older printer
drivers can be replaced by the ijs interface and one of the available 3rd party raster
driver collections. We recommend moving to the ijs device for all such printing.</p>

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="Measurements"></a>Notes on measurements</h2>

<p>
Several different important kinds of measures appear throughout this
document: inches, centimeters and millimeters, points, and bits per pixel.

<dl>

<dt>Centimeters and millimeters</dt>
<dd>ISO standard paper sizes such as A4 and A3 are commonly represented in
the SI units of centimeters and millimeters.  Centimeters are abbreviated
<dfn><abbr>cm</abbr></dfn>, millimeters <dfn><abbr>mm</abbr></dfn>.  ISO A4 paper is
quite close to 210&times;297 millimeters (approximately 8.3&times;11.7
inches).</dd>

<dt>Inches</dt>
<dd>1 inch equals 2.54 centimeters.  The inch measure is sometimes
represented by <dfn><abr>in</abr></dfn> or a quotation mark (<abr>&quot;</abr>) to the right
of a measure, like 8.5in or 8.5&quot;. 
U.S. "letter" paper is exactly
8.5in&times;11in, approximately 21.6cm&times;27.9cm.  (See in the usage
documentation all the <a href="Use.htm#Known_paper_sizes">paper sizes
predefined in Ghostscript</a>.)</dd>

<dt>Points</dt>
<dd>Points are a measure traditionally used in the printing trade and now
in PostScript, which specifies exactly 72 points per inch (approximately
28.35 per centimeter).  The <a href="Use.htm#Known_paper_sizes">paper sizes
known to Ghostscript</a> are defined in the initialization file
<tt>gs_statd.ps</tt> in terms of points.</dd>

<dt>Dots per inch</dt>
<dd>Dots per inch or <dfn><abbr>dpi</abbr></dfn> is the common measure of 
printing resolution in the US.</dd>

<dt>Bits per pixel</dt>
<dd>Commonly abbreviated <dfn><abbr>bpp</abbr></dfn> this is the number of 
digital bits used to represent the color of each pixel. This is also referred
to as 'bit depth' or 'pixel depth'.</dd>

</dl>

<hr>

<h2><a name="File_formats"></a>Image file formats</h2>

<p>
Ghostscript supports output to a variety of image file formats
and is widely used for rasterizing postscript and pdf files.
A collection of such formats ('output devices' in Ghostscript terminology)
are described in this section.
</p>

<p>
Here are some commonly useful driver options that apply to all raster drivers.
Options specific to particular file formats are described in their respective
sections below.</p>

<blockquote><dl>

<dt>-sOutputFile=<em>filename</em></dt>
<dd><p>This is a general option telling Ghostscript what to name the output. 
It can either be a single filename '<tt>tiger.png</tt>' or a template
'<tt>figure-%03d.jpg</tt>' where the <tt>%03d</tt> is replaced by the page number.</p>


<dt>-r<em>res</em></dt>
<dt>-r<em>xres</em>x<em>yres</em></dt>
<dd><p>This option sets the resolution of the output file in dots per inch.
The default value if you don't specify this options is usually 72 <abbr>dpi</abbr>.</p></dd>

<dt>-dTextAlphaBits=<em>n</em></dt>
<dt>-dGraphicsAlphaBits=<em>n</em></dt>
<dd><p>These options control the use of subsample antialiasing. Their use is highly recommended
for producing high quality rasterizations of the input files. The size of the subsampling
box <em>n</em> should be 4 for optimum output, but smaller values can be used for faster
rendering. Antialiasing is enabled separately for text and graphics content.</p></dd>

</dl></blockquote>

<p>
It is also conventional to call Ghostscript with the '<tt>-dSAFER -dBATCH -dNOPAUSE</tt>' trio
of options when rasterizing to a file. These suppress interactive prompts and enable some 
security checks on the file to be run. Please see the <a href="Use.htm">Use documentation</a>
for a complete description.
</p>
 
<h3><a name="PNG"></a>PNG file format</h3>

<p><acronym>PNG</acronym> (pronounced 'ping') stands for Portable Network Graphics,
and is the recommended format for high-quality images. It supports full quality
color and transparency, offers excellent lossless compression of the image data,
and is widely supported. Please see the 
<a href="http://www.libpng.org/pub/png/pngintro.html" class="offsite">PNG website</a>
for a complete description of the format.</p>

<p>Ghostscript provides a variety of devices for <acronymn>PNG output
varying by bit depth. For normal use we recommend <tt>png16m</tt> for 24-bit RGB color,
or <tt>pnggray</tt> for grayscale. The png256, png16 and pngmono devices respectively
provide 8-bit color, 4-bit color and black-and-white for special needs.</p>

<p>The pngalpha device is 32-bit RGBA color with transparency 
indicating pixel coverage.  The background is transparent unless
it has been explicitly filled.  PDF 1.4 transparent files do not
give a transparent background with this device.  Text and graphics 
anti-aliasing are enabled by default.</p>

<h4>Options</h4>

<p>The pngalpha device has one option. 
The other png devices have no special options.</p>

<blockquote>
<dl>
<dt><b><tt>-dBackgroundColor=</tt></b><b><em>16#RRGGBB</em></b> (RGB color, default white = 16#ffffff)
<dd>For the <tt>pngalpha</tt> device only, 
set the suggested background color in the PNG bKGD chunk.  
When a program reading a PNG file does not support alpha
transparency, the PNG library converts the image using
either a background color if supplied by the program
or the bKGD chunk.
One common web browser has this problem, so when using
<b><tt>&lt;body bgcolor="CCCC00"&gt;</tt></b> on a web page
you would need to use <b><tt>-dBackgroundColor=16#CCCC00</tt></b>
when creating alpha transparent PNG images for use on the
page.
</dl>
</blockquote>

<h4>Examples</h4>

<p>Examples of how to use Ghostscript to convert postscript to PNG image files:

<blockquote>
<pre>
 <kbd>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
      -sOutputFile=tiger.png examples/tiger.png</kbd>
      
 <kbd>gs -dSAFER -dBATCH -dNOPAUSE -r150 -sDEVICE=pnggray -dTextAlphaBits=4 \
      -sOutputFile=doc-%02d.png doc.pdf</kbd>
</pre>
</blockquote>
<p></p> 

<h3><a name="JFIF"></a>JPEG file format (JFIF)</h3>

<p>
Ghostscript includes output drivers that can produce jpeg files
from postscript or pdf images. These are the <tt>jpeg</tt> and 
<tt>jpeggray</tt> devices.

<p>Technically these produce <a href="http://www.ijg.org/">Independent JPEG Group</a>
JFIF (JPEG File Interchange Format) files, the common sort found on the web.</p>

<p><strong>Please note</strong> that
JPEG is a compression method specifically intended for continuous-tone
images such as photographs, not for graphics, and it is therefore quite
unsuitable for the vast majority of page images produced with PostScript.
For anything other than pages containing simple images the lossy compression
of the jpeg format will result in poor quality output regardless of the input.
To learn more about the distinction, consult a reference about uses and abuses of JPEG,
such as the JPEG FAQ

<blockquote>
<a href="http://www.faqs.org/faqs/jpeg-faq/" class="offsite">http://www.faqs.org/faqs/jpeg-faq/</a>
</blockquote>

<h4>Examples</h4>

<p>
You can use the JPEG output drivers -- <b><tt>jpeg</tt></b> to produce
color JPEG files and <b><tt>jpeggray</tt></b> for grayscale JPEGs -- the
same as other file-format drivers: by specifying the device name and an
output file name, for example

<blockquote>
<pre><kbd>gs -sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps</kbd></pre>
</blockquote>

<h4>Options</h4>

<p>
The JPEG devices support several special parameters to control the JPEG
"quality setting" (DCT quantization level).</p>

<blockquote>
<dl>
<dt><b><tt>-dJPEGQ=</tt></b><b><em>N</em></b> (integer from 0 to 100, default 75)
<dd>Set the quality level <b><em>N</em></b> according to the widely used
IJG quality scale, which balances the extent of compression against the
fidelity of the image when reconstituted.  Lower values drop more
information from the image to achieve higher compression, and therefore
have lower quality when reconstituted.

<dt><b><tt>-dQFactor=</tt></b><b><em>M</em></b> (float from 0.0 to 1.0)
<dd>Adobe's QFactor quality scale, which you may use in place of
<b><tt>JPEGQ</tt></b> above.  The QFactor scale is used by PostScript's
DCTEncode filter but is nearly unheard-of elsewhere.
</dl>
</blockquote>

<p>
At this writing the default JPEG quality level of 75 is equivalent to
<b><tt>-dQFactor=0.5</tt></b>, but the JPEG default might change in the
future.  There is currently no support for any additional JPEG
compression options, such as the other DCTEncode filter parameters.
</p>


<h3><a name="PNM"></a>PNM</h3>

<p>The PNM (portable network map) family of formats are very simple
uncompressed image formats commonly used on unix-like systems. They
are particularly useful for testing or as input to an external conversion
utility.</p>

<p>A wide variety of data formats and depths is supported. Devices include
<tt>pbm
   pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm
   pksmraw</tt>.
</p>
 
<h3><a name="TIFF"></a>TIFF file formats</h3>

<p><acronym>TIFF</acronym> is a loose collection of formats, now largely
superceded by <acronym>PNG</acronym> except in applications where backward
compatibility or special compression is required. The <acronym>TIFF</acronym> 
file format is described in the
<a href="http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf" class="offsite">TIFF 6.0 Specification</a> 
published by Adobe Systems Incorporated.</p>

<p>
There are two unrelated sets of TIFF drivers.  There are two color TIFF
drivers that produce uncompressed output:

<blockquote>
<dl>
<dt><b><tt>tiff24nc</tt></b>
<dd>Produces 24-bit RGB output (8 bits per component).
<dt><b><tt>tiff12nc</tt></b>
<dd>Produces 12-bit RGB output (4 bits per component).
</dl>
</blockquote>

<p>
The remaining TIFF drivers all produce black-and-white output with different
compression modes:

<blockquote>
<dl>
<dt><b><tt>tiffcrle</tt></b>
<dd>G3 fax encoding with no EOLs
<dt><b><tt>tiffg3</tt></b>
<dd>G3 fax encoding with EOLs
<dt><b><tt>tiffg32d</tt></b>
<dd>2-D G3 fax encoding
<dt><b><tt>tiffg4</tt></b>
<dd>G4 fax encoding
<dt><b><tt>tifflzw</tt></b>
<dd>LZW-compatible (tag = 5) compression
<dt><b><tt>tiffpack</tt></b>
<dd>PackBits (tag = 32773) compression
</dl>
</blockquote>


<h4>Options</h4>

<p>
The black-and-white TIFF drivers support creation of files that are
comprised of more than a single strip.  Multi-strip files reduce the memory
requirement on the reader, since readers need only store and process one
strip at a time.  These drivers provide two parameters beyond the standard
set:

<blockquote>
<dl>
<dt><b><tt>-dMaxStripSize=</tt><em>N</em></b> (non-negative integer; default = 0)
<dd>Set the maximum (uncompressed) size of a strip.

<dt><b><tt>-dAdjustWidth</tt><em>state</em></b> (0 or 1; default = 1)
<dd>If this option set then if the requested page width is close to either A4 (1728 columns) or B4 (2048 columns), set the page width to A4 or B4 respectively.
This behavior is the default. Pass -dAdjustWidth=0 to turn off this behavior.
</dl></blockquote>

<p>
The TIFF 6.0 specification, Section 7, page 27, recommends that the size of
each strip be about 8 Kbytes.  As an example, to generate the 'tiger' in
tiffg4 format that has the recommended strip size, use:

<blockquote><pre>
gs -sDEVICE=tiffg4 -sOutputFile=tiger.tiff -dMaxStripSize=8192 examples/tiger.eps
</pre></blockquote>

<p>
If the value of the <tt>MaxStripSize</tt> parameter is smaller than a
single image row, then no error will be generated, and the TIFF file will be
generated correctly using one row per strip.  Note that smaller strip sizes
increase the size of the file by increasing the size of the StripOffsets and
StripByteCounts tables, and by reducing the effectiveness of the compression
which must start over for each strip.

<p>
If the value of MaxStripSize is 0 (the default), then the entire image will
be a single strip.

<h3><a name="fax"></a>FAX</h3>

<p>
Ghostscript supports a variety of fax encodings, both encapsulated in 
<acronym>TIFF</acronym> (see above) and as raw files. The later case is
described here.
</p>

<p>
The fax devices are <tt>faxg3</tt>, <tt>faxg32d</tt> and <tt>faxg4</tt>.
</p>

<h3><a name="BMP"></a>BMP</h3>

<p>
BMP is a simple uncompressed image format commonly used on MS Windows.
It is supported by the devices <tt>bmpmono bmpgray bmpsep1
   bmpsep8 bmp16 bmp256 bmp16m bmp32b</tt>.
</p>

<h3><a name="PCX"></a>PCX</h3>

<p>
PCX is an image format sometimes used on MS Windows. It has some support
for image compression and alternate color spaces, and so can be a useful
way to output CMYK. 
It is supported by the <tt>pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk</tt> 
series of devices.
</p>

<h3><a name="PSD"></a>PSD</h3>

<p>
PSD is the image format used by Adobe Photoshop.
It is supported by the <tt>psdcmyk</tt> and <tt>psdrgb</tt> devices.
Of special interest with the <tt>psdcmyk</tt> device is that it supports spot
colors.  The names of the spot colors
must be specified prior to opening a page. This can be done via adding the
following to the command line: <b><tt>-c "<< /SeparationColorNames [ /Name1 /Name2 ]
>> setpagedevice" -f</tt></b>. The <tt>psdcmyk</tt> device will support up to four
spot colors.
To view the results properly, a color needs to be assigned to each of
the spot color planes within Photoshop.  (Ghostscript assigns black as
the default color for all spot colors in the psdcmyk device.)



</p>

<h2><a name="High-level"></a>High-level devices</h2>

<p>
In addition to raster image files, Ghostscript supports output in a number
of 'high-level' formats. These allow Ghostscript to preserve (as much as
possible) the drawing elements of the input file maintaining flexibility,
resolution independence, and editability.</p>

<h3><a name="PDF"></a>PDF writer</h3>

<p>The <tt>pdfwrite</tt> device outputs PDF.</p>

<h3><a name="PS"></a>PS writer</h3>

<p>The <tt>pswrite</tt> device outputs postscript.</p>

<h4>Options</h4>

<blockquote>
<dl>
<dt><b><tt>-dLanguageLevel=</tt><em>1 | 1.5 | 2 | 3</em></b> (default is 2)
<dd>Set the language level of the generated file.
Language level 1.5 is language level 1 with color extensions. 
Currently language level 3 generates the same PostScript as 2.
</dl></blockquote>

<h3><a name="EPS"></a>EPS writer</h3>

<p>The <tt>epswrite</tt> device outputs encapsulated postscript.</p>

<h4>Options</h4>

<blockquote>
<dl>
<dt><b><tt>-dLanguageLevel=</tt><em>1 | 1.5 | 2 | 3</em></b> (default is 2)
<dd>Set the language level of the generated file.
Language level 1.5 is language level 1 with color extensions. 
Currently language level 3 generates the same PostScript as 2.
</dl></blockquote>

<h3><a name="PXL"></a>PXL</h3>

<p>The <tt>pxlmono</tt> and <tt>pxlcolor</tt> devices output HP PCL-XL,
a graphic language understood by many recent laser printers.</p>

<h3><a name="Unicode"></a>Unicode support for high level devices</h3>

<p>Implementing a new high level device, one may need to translate <b><tt>Postscript</b></tt>
character codes into <b><tt>Unicode</b></tt>. This can be done pretty simply.

<p>For translating a <b><tt>Postscript</b></tt> text you need to inplement the device
virtual function <b><tt>text_begin</b></tt>. It should create a new instance of
<b><tt>gs_text_enum_t</b></tt> in the heap (let its pointer be <b><tt>pte</b></tt>),
and assign a special function to <b><tt>gs_text_enum_t::procs.process</b></tt>.
The function will receive <b><tt>pte</b></tt>. It should take the top level font from
<b><tt>pte->orig_font</b></tt>,
and iterate with <b><tt>font->procs.next_char_glyph(pte, ..., &glyph)</b></tt>.
The last argument receives a <b><tt>gs_glyph</b></tt> value, which encodes a
<b><tt>Postscript</b></tt> character name or CID (and also stores it into
<b><tt>pte->returned.current_glyph</b></tt>).
Then obtain the current subfont with <b><tt>gs_text_current_font(pte)</b></tt>
(it can differ from the font)
and call <b><tt>subfont->procs.decode_glyph(subfont, glyph)</b></tt>.
The return value will be an <b><tt>Unicode</b></tt> code, or <b><tt>GS_NO_CHAR</b></tt>
if the glyph can't be translated to Unicode.

<p>

<hr>

<h2><a name="Display_devices"></a>Display Devices</h2>

<p>
Ghostscript is often used for screen display of postscript and pdf documents.
In many cases, a client or 'viewer' application calls the Ghostscript engine
to do the rasterization and handles the display of the resulting image itself,
but it is also possible to invoke Ghostscript directly and select an output
device which directly handles displaying the image on screen.

<p>
This section describes the various display-oriented devices that are available
in Ghostscript.

<h3><a name="x11_devices"></a>X Window System</h3>

<p>
Perhaps the most common use of of a display device is with the X Window System
on unix-like systems. It is the default device on the command line client on
such systems, and is used more creatively by the gv client application.

<p>
The available devices are:

<dl>
<dt><b>x11</b>
<dd>This is the default device, handling display on X11R6.

<dt><b>x11alpha</b>
<dd>This is the x11 device, but with antialiasing. It is equivalent to
invoking the x11 device with the options <tt>-dGraphicsAlphaBits=4 
-dTextAlphaBits=4 -dMaxBitmap=50000000</tt>.

<dt><b>x11cmyk</b>
<dd>This device rasterizes the image in the CMYK color space, then flattens
it to RGB for display. It's intended for testing only.

<dt><b>x11mono</b>
<dd>This is a strict black-and-white device for 1-bit monochrome displays.

<dt><b>x11gray2</b>
<dd>This is a device for 2 bpp (4-level) monochrome displays.

<dt><b>x11gray4</b>
<dd>This is a device for 4 bpp (16-level) monochrome displays.
</dl>


<hr>

<h2><a name="IJS"></a>IJS - Inkjet and other raster devices</h2>

<p>
IJS is a relatively new initiative to improve the quality and ease of
use of inkjet printing with Ghostscript. Using IJS, you can add new
drivers, or upgrade existing ones, without recompiling Ghostscript.
All driver authors are encouraged to adapt their drivers for IJS, and
if there is an IJS driver available for your printer, it should be
your first choice.
</p>

<p>Please see the <a href="http://www.linuxprinting.org/ijs/">IJS web
page</a> for more information about IJS, including a listing of
IJS-compatible drivers.
</p>

<p>
A typical command line for IJS is:
</p>

<blockquote>
<b><tt>
gs -dSAFER -sDEVICE=ijs -sIjsServer=hpijs 
 -sDeviceManufacturer=HEWLETT-PACKARD -sDeviceModel='DESKJET 990'
 -dIjsUseOutputFD -sOutputFile=/dev/usb/lp1 -dNOPAUSE --
 examples/tiger.eps
</tt></b>
</blockquote>


<p>
Individual IJS command line parameters are as follows:
</p>

<dl>
<dt><b><tt>-sIjsServer=</tt></b><em>{path}</em>
<dd>Sets the pathname for the IJS server (ie printer driver).
Ghostscript will spawn a new process for this driver, and communicate
with it using the IJS protocol. The pathname need not be absolute,
as the PATH environment variable is searched, but it's probably a good
idea for robustness and security. Note also that if -dSAFER is not
specified, it's possible for PostScript code to set this parameter,
so it can cause arbitrary code to be executed. See the section on <a
href="Use.htm#Security">Security</a> for more information.
</dl>

<dl>
<dt><b><tt>-sDeviceManufacturer=</tt></b><em>{name}</em>
<dt><b><tt>-sDeviceModel=</tt></b><em>{name}</em>
<dd>These parameters select the device according to IEEE-1284 standard
device ID strings. In general, consult the documentation for the
driver to find the appropriate settings. Note that, if the value
contains a space, you'll want to quote the value in your shell, as
in the example above.
</dl>

<dl>
<dt><b><tt>-sIjsParams=</tt></b><em>{params}</em>
<dd>This parameter allows you to set arbitrary IJS parameters on
the IJS driver. The format is a comma-separated list of
<b><tt>key=value</tt></b> pairs. If it is necessary to send a
value containing a comma or backslash, it can be escaped with
a backslash. Thus, <b><tt>'-sIjsParams=Foo=bar,Baz=a\,b'</tt></b> sets
the parameter Foo to "bar", and Baz to "a,b".
</dl>

<dl>
<dt><b><tt>-dIjsUseOutputFD</tt></b>
<dd>This flag indicates that Ghostscript should open the output file
and pass a file descriptor to the server. If not set, Ghostscript
simply passes the filename set in OutputFile to the server. In most
cases, this flag won't matter, but if you have a driver which works
only with OutputFD (such as hpijs 1.0.2), or if you're using the
-sOutputFile="|cmd" syntax, you'll need to set it.
</dl>

<dl>
<dt><b><tt>-dBitsPerSample=</tt></b><em>N</em>
<dd>This parameter controls the number of bits per sample. The
default value of 8 should be appropriate for most work. For monochrome
images, use -dBitsPerSample=1.
</dl>

<p>Generic Ghostscript options that are particularly relevant for IJS
are summarized below:
</p>

<dl>
<dt><b><tt>-r</tt></b><em>number</em>
<br><b><tt>-r</tt></b><em>number1</em><b><tt>x</tt></b><em>number2</em>
<dd>Sets the resolution, in dpi. If the resolution is not specified,
Ghostscript queries the IJS server to determine the preferred resolution.
When the resolution is specified, it overrides the value (if any)
preferred by the IJS server.
</dl>

<dl>
<dt><b><tt>-dDuplex</tt></b>
<dt><b><tt>-dTumble</tt></b>
<dd>These flags enable duplex (two-sided) printing. Tumble controls
the orientation. When Tumble is false, the pages
are oriented suitably at the left or right. When Tumble is true,
the pages are oriented suitably for binding at the top or
bottom.
</dl>

<dl>
<dt><b><tt>-sProcessColorModel=</tt></b><em>{name}</em>
<dd>Use this flag to select the process color model. Suitable values
include DeviceGray, DeviceRGB, and DeviceCMYK.
</dl>

<h3>Building IJS</h3>

<p> IJS is included by default on Unix gcc builds, and also in
autoconf'ed builds. Others may need some makefile tweaking. First,
make sure the IJS device is selected:

<blockquote>
DEVICE_DEVS2=$(DD)ijs.dev
</blockquote>

<p> Next, make sure that the path and execution type are set in
the top level makefile. The values for Unix are as follows:

<blockquote>
IJSSRCDIR=ijs
IJSEXECTYPE=unix
</blockquote>

<p> At present, "unix" and "win" are the only supported values for
IJSEXECTYPE. If neither sounds appropriate for your system, it's
possible that more porting work is needed.

<p> Last, make sure that ijs.mak is included in the top level makefile.
It should be present right after the include of icclib.mak.

<p> IJS is not inherently platform-specific. We're very much interested
in taking patches from people who have ported it to non-mainstream
platforms. And once it's built, you won't have to recompile Ghostscript
to support new drivers!

<h2><a name="HP_ijs"></a>HP Deskjet official drivers</h2>

<p>
HP provides official drivers for many of their Deskjet printer models.
In order to use these drivers, you will need the HP Inkjet Server as
well as Ghostscript, available from <a
href="http://hpinkjet.sourceforge.net">http://hpinkjet.sourceforge.net</a>.
This version of Ghostscript includes the patch from version 0.97 of
the hpijs software. If you are installing hpijs from an RPM, you will
only need the hpijs RPM, not the Ghostscript-hpijs one, as the code
needed to work with hpijs is already included.

<p>
Note that newer version of the hpijs drivers support the IJS protocol.
If you can, you should consider using the ijs driver instead. Among
other things, the hpijs Ghostscript driver is Unix-only, and is untested
on older Unix platforms.

<p>
As of the 0.97 version, hpijs supports the following printer models:

<dl><dt><b>e-Series:</b>
 <dd>e-20
<dt><b>DeskJet 350C Series:</b>
 <dd>350C
<dt><b>DeskJet 600C Series:</b>
 <dd>600C, 660C, 670/672C, 670TV, 680/682C
<dt><b>DeskJet 600C Series Photo:</b>
 <dd>610/612C, 640/648C, 690/692/693/694/695/697C
<dt><b>DeskJet 630C Series:</b>
 <dd>630/632C
<dt><b>DeskJet 800C Series:</b>
 <dd>810/812C, 830/832C, 840/842/843C, 880/882C, 895C
<dt><b>DeskJet 900C Series, PhotoSmart::</b>
 <dd>930/932C, 950/952C, 970C, PhotoSmart 1000/1100
<dt><b>DeskJet 990C, PhotoSmart:</b>
 <dd>960C, 980C, 990C, PhotoSmart 1215/1218

</dl>

<p>You will need to add the following line to your makefile:

<blockquote>
DEVICE_DEVS2=$(DD)DJ630.dev $(DD)DJ6xx.dev $(DD)DJ6xxP.dev $(DD)DJ8xx.dev $(DD)DJ9xx.dev $(DD)DJ9xxVIP.dev $(DD)AP21xx.dev
</blockquote>

<p>
Please see <a
href="http://hpinkjet.sourceforge.net">http://hpinkjet.sourceforge.net</a>
for more information about this driver. Thanks to the folks at HP,
especially David Suffield for making this driver available and working to
integrate it with Ghostscript.
</p>

<h2><a name="gimp-print"></a>Gimp-Print driver collection</h2>

<p>
The Gimp-Print project provides a large collection of printer drivers 
with an IJS interface. Please see their 
<a href="http://gimp-print.sourceforge.net/" class="offsite">website</a> 
for details.
</p>

<hr>
<h2><a name="Win"></a>MS Windows printers</h2>

<p>
This section was written by Russell Lang, the author of Ghostscript's
MS&nbsp;Windows-specific printer driver, and updated by
<a href="mailto:Pierre.Arnaud@opac.ch">Pierre Arnaud</a>,
the current maintainer.
</p>

<p>
The <b><tt>mswinpr2</tt></b> device uses MS&nbsp;Windows printer drivers, and
thus should work with any printer with device-independent bitmap (DIB)
raster capabilities. The printer resolution cannot be selected directly
using PostScript commands from Ghostscript: use the printer setup in the
Control Panel instead. It is however possible to specify a maximum resolution
for the printed document (see below).
</p>

<p>
If no Windows printer name is specified in <b><tt>-sOutputFile</tt></b>,
Ghostscript prompts for a Windows printer using the standard Print Setup
dialog box.  You must set the orientation to Portrait and the page size to
that expected by Ghostscript; otherwise the image will be clipped.
Ghostscript sets the physical device size to that of the Windows printer
driver, but it does not update the PostScript clipping path.
</p>

<p>
If a Windows printer name is specified in <b><tt>-sOutputFile</tt></b> using
the format <tt>"%printer%printer_name"</tt>, for instance
</p>

<blockquote><b><tt>
gs ... -sOutputFile="%printer%Apple LaserWriter II NT"
</tt></b></blockquote>

<p>
then Ghostscript attempts to open the Windows printer without prompting
(except, of course, if the printer is connected to <b><tt>FILE:</tt></b>).
Ghostscript attempts to set the Windows printer page size and orientation
to match that expected by Ghostscript, but doesn't always succeed.  It uses
this algorithm:
</p>

<ol>
<li>If the requested page size matches one of the Windows standard page
sizes +/- 2mm, request that standard size.</li>

<li>Otherwise if the requested page size matches one of the Windows
standard page sizes in landscape mode, ask for that standard size in
landscape.</li>

<li>Otherwise ask for the page size by specifying only its dimensions.</li>

<li>Merge the requests above with the defaults.  If the printer driver
ignores the requested paper size, no error is generated: it will print on
the wrong paper size.</li>

<li>Open the Windows printer with the merged orientation and size.</li>
</ol>

<p>
The Ghostscript physical device size is updated to match the Windows
printer physical device.
</p>

<h3><a name="Win_properties"></a>Supported command-line parameters</h3>

<p>
The <b><tt>mswinpr2</tt></b> device supports a limited number of command-line
parameters (e.g. it does not support setting the printer resolution). The
recognized parameters are the following:
</p>

<blockquote>
<dl>
<dt><b><tt>-sDEVICE=mswinpr2</tt></b></dt>
<dd>Selects the MS&nbsp;Windows printer device. If Ghostscript was not
compiled with this device as the default output device, you have to specify
it on the command line.</dd>

<dt><b><tt>-dNoCancel</tt></b></dt>
<dd>Hides the progress dialog, which shows the percent of the document page
already processed and also provides a <em>cancel</em> button. This option
is useful if GS is intended to print pages in the background, without any
user intervention.</dd>

<dt><b><tt>-sOutputFile=</tt></b><b>"%printer%<em>printer_name</em>"</b></dt>
<dd>Specifies which printer should be used. The <em>printer_name</em> should be
typed exactly as it appears in the Printers control panel, including spaces.</dd>

</dl>
</blockquote>

<h3><a name="Win_options"></a>Supported options (device properties)</h3>

<p>
Several extra options exist which cannot be set through the command-line,
but only by executing the appropriate PostScript setup code. These options
can be set through the inclusion of a setup file on the command-line:
</p>

<blockquote><b><tt>
gs ... setup.ps ...
</tt></b></blockquote>

<p>
The <tt>setup.ps</tt> file is responsible for the device selection, therefore
you should not specify the <b><tt>-sDEVICE=mswinpr2</tt></b> option on the
command-line if you are using such a setup file. Here is an example of such
a setup file:
</p>

<blockquote><pre>
mark
  /NoCancel      true                       % don't show the cancel dialog
  /BitsPerPixel  4                          % force 4 bits/pixel
  /UserSettings
    &lt;&lt;
      /DocumentName  (Ghostscript document) % name for the Windows spooler
      /MaxResolution 360                    % maximum document resolution
    &gt;&gt;
  (mswinpr2) finddevice                     % select the Windows device driver
  putdeviceprops
setdevice
</pre></blockquote>

<p>
This example disables the progress dialog (same as the <tt><b>-dNoCancel</b></tt>
option), forces a 4 bits/pixel output resolution and specifies additional user
settings, such as the document name (which will be displayed by the Windows
spooler for the queued document) and the maximum resolution (here 360&nbsp;dpi).
It then finds and selects an instance of the MS&nbsp;Windows device printer
and activates it. This will show the standard printer dialog, since no
<tt><b>/OutputFile</b></tt> property was specified.
</p>

<p>
The following options are available:
</p>

<blockquote>
<dl>
<dt><b><tt>/NoCancel <em>boolean</em></tt></b></dt>
<dd>Disables (hides) the progress dialog when set to <em><tt>true</tt></em> or
show the progress dialog if not set or set to <em><tt>false</tt></em>.</dd>

<dt><b><tt>/OutputFile <em>string</em></tt></b></dt>
<dd>Specifies which printer should be used. The string should be of the form
<tt><b>%printer%<em>printer_name</em></b></tt>, where the <em>printer_name</em> should be
typed exactly as it appears in the Printers control panel, including spaces.</dd>

<dt><b><tt>/QueryUser <em>integer</em></tt></b></dt>
<dd>Shows the standard printer dialog (<tt><b>1</b></tt> or any other value),
shows the <em>printer setup dialog</em> (<tt><b>2</b></tt>) or selects the
<em>default Windows printer</em> without any user interaction (<tt><b>3</b></tt>).</dd>

<dt><b><tt>/BitsPerPixel <em>integer</em></tt></b></dt>
<dd>Sets the device depth to the specified bits per pixel. Currently supported
values are <tt><b>1</b></tt> (monochrome), <tt><b>4</b></tt> (CMYK with screening
handled by Ghostscript) and <tt><b>24</b></tt> (True Color, dithering handled by
the Windows printer driver; this option can produce huge print jobs).</dd>

<dt><b><tt>/UserSettings <em>dict</em></tt></b></dt>
<dd>Sets additional options, defined in a dictionary. The following properties can
be set:

<dl>
<dt><b><tt>/DocumentName <em>string</em></tt></b></dt>
<dd>Defines the user friendly document name which will be displayed by the
Windows spooler.</dd>

<dt><b><tt>/DocumentRange <em>[n1 n2]</em></tt></b></dt>
<dd>Defines the range of pages contained in the document. This information can
be used by the printer dialog, in conjunction with the following property.</dd>

<dt><b><tt>/SelectedRange <em>[n1 n2]</em></tt></b></dt>
<dd>Defines the selected range of pages. This information will be displayed in
the printer dialog and will be updated after the user interaction. A PostScript
program could check these values and print only the selected page range.</dd>

<dt><b><tt>/MaxResolution <em>dpi</em></tt></b></dt>
<dd>Specifies the maximum tolerated output resolution. If the selected printer has
a higher resolution than <tt><b>dpi</b></tt>, then Ghostscript will render the
document with a submultiple of the printer resolution. For example, if 
<tt><b>MaxResolution</b></tt> is set to 360 and the output printer supports
up to 1200 dpi, then Ghostscript renders the document with an internal
resolution of 1200/4=300 dpi. This can be very useful to reduce the memory
requirements when printing in True Color on some high resolution ink-jet color
printers.</dd>

</dl></dd>

</dl>
</blockquote>

<p>
These properties can be queried through the <tt><b>currentpagedevice</b></tt>
operator. The following PostScript code snippet shows how to do it for some
of the properties:
</p>

<blockquote><pre>
currentpagedevice /BitsPerPixel get ==  % displays the selected depth

currentpagedevice /UserSettings get     % get the additional options..
/us exch def                            % ..and assign them to a variable

us /DocumentName get ==     % displays the document name
us /SelectedRange get ==    % displays the selected page range

% other misc. information (don't rely on them)

us /Color get ==            % 1 => monochrome output, 2 => color output
us /PrintCopies get ==      % displays the number of copies requested
</pre></blockquote>

<p>
There are a few undocumented parameters stored in the <tt><b>UserSettings</b></tt>
dictionary. You should not rely on them. Their use is still experimental and
they could be removed in a future version.
</p>

<h3><a name="Win_duplex"></a>Duplex printing</h3>

<p>
If the Windows printer supports the duplex printing feature, then it will
also be available through the <b><tt>mswinpr2</tt></b> device. You can query
for this support through the <b><tt>/Duplex</tt></b> property of the
<b><tt>currentpagedevice</tt></b>. If it returns <b><tt>null</tt></b>, then
the feature is not supported by the selected printer. Otherwise, <b><tt>true</tt></b>
means that the printer is currently set up to print on both faces of the paper
and <b><tt>false</tt></b> that it is not, but that it can.
</p>

<p>
The following example shows how to print on both faces of the paper (using
the long side of the paper as the reference):
</p>

<blockquote><pre>
&lt;&lt; /Duplex true /Tumble false &gt;&gt; setpagedevice
</pre></blockquote>

<p>
</p>


<hr>

<h2><a name="SPARCprinter"></a>Sun SPARCprinter</h2>

<p>
This section was contributed by Martin Schulte.

<p>
With a SPARCprinter you always buy software that enables you to do
PostScript printing on it.  A page image is composed on the host, which
sends a bitmap to the SPARCprinter through a special SBUS video interface.
So the need for a Ghostscript interface to the SPARCPrinter seems low, but
on the other hand, Sun's software prints some PostScript drawings
incorrectly: some pages contain a thin vertical line of rubbish, and on
some Mathematica drawings the text at the axes isn't rotated.  Ghostscript,
however, gives the correct results.  Moreover, replacing proprietary
software should never be a bad idea.

<p>
The problem is that there has yet been no effort to make the SPARCPrinter
driver behave like a BSD output filter.  I made my tests using the script
shown here.

<h3><a name="SPARC_install"></a>Installation</h3>

<p>
Add <b><tt>sparc.dev</tt></b> to <b><tt>DEVICE_DEVS</tt></b> and compile
Ghostscript as described in the documentation on <a href="Make.htm">how to
build Ghostscript</a>.  Afterwards you can use the following script as an
example for printing after modifying it with the right pathnames --
including for <b>{GSPATH}</b> the full pathname of the Ghostscript
executable:

<blockquote>
<pre>outcmd1='/vol/local/lib/troff2/psxlate -r'
outcmd2='<b><em>{GSPATH}</em></b> -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -'

if [ $# -eq 0 ]
then
  $outcmd1 | $outcmd2
else
  cat $* | $outcmd1 | $outcmd2
fi
</pre></blockquote>

<h3><a name="SPARC_problems"></a>Problems</h3>

<p>
Since <b><tt>/dev/lpi</tt></b> can be opened only for exclusive use, if
another job has it open (engine_ctl_sparc or another Ghostscript are the
most likely candidates), Ghostscript stops with "Error: /invalidfileaccess
in --.outputpage--"

<p>
In case of common printer problems like being out of paper, a warning
describing the reason is printed to stdout.  The driver tries access again
each five seconds.  Due to a problem with the device driver (in the kernel)
the reason for printer failure isn't always reported correctly to the
program.  This is the case, for instance, if you open the top cover (error
E5 on the printer's display).  Look at the display on the printer itself if
a "Printer problem with unknown reason" is reported.  Fatal errors cause
the print job to be terminated.

<p>
Note: there is some confusion whether the resolution setting should be
the integers 300 and 400, or the symbolic constants DPI300 and DPI400
(defined in lpviio.h). Ghostscript releases have had it both ways. It
is currently the latter. However, INOUE Namihiko reports (in bug
<a href="http://bugs.ghostscript.com/show_bug.cgi?id=215256"
class="offsite">#215256</a>)
that the former works better for him. If anyone
has a definitive answer, please let us know.

<hr>

<h2><a name="Apple"></a>Apple dot matrix printer</h2>

<p>
This section was contributed by Mark Wedel
&lt;<a href="mailto:master@cats.ucsc.edu">master@cats.ucsc.edu</a>&gt;.

<p>
The Apple Dot Matrix Printer (DMP) was a parallel predecessor to the
Imagewriter printer.  As far as I know, Imagewriter commands are a superset
of the Dot Matrix printer's, so the driver should generate output that can
be printed on Imagewriters.

<p>
To print images, the driver sets the printer for unidirectional printing
and 15 characters per inch (cpi), or 120dpi.  It sets the line feed to 1/9
inch.  When finished, it sets the printer to bidirectional printing,
1/8-inch line feeds, and 12 cpi.  There appears to be no way to reset the
printer to initial values.

<p>
This code does not set for 8-bit characters (which is required).  It also
assumes that carriage return-newline is needed, and not just carriage
return.  These are all switch settings on the DMP, and I have configured
them for 8-bit data and carriage return exclusively.  Ensure that the Unix
printer daemon handles 8-bit (binary) data properly; in my SunOS 4.1.1
<b><tt>printcap</tt></b> file the string "<b><tt>ms=pass8,-opost</tt></b>"
works fine for this.

<p>
Finally, you can search <b><tt>devdemp.c</tt></b> for
"<b><tt>Init</tt></b>" and "<b><tt>Reset</tt></b>" to find the strings that
initialize the printer and reset things when finished, and change them to
meet your needs.


<hr>

<h2><a name="Test"></a>Special and Test devices</h2>

<p>
The devices in this section are intended primarily for testing. They may
be interesting as code examples, as well.

<h3>Raw 'bit' devices</h3>

<p>There are a collection of 'bit' devices that don't do any special formatting
but output 'raw' binary data for the page images. These are used for benchmarking
but can also be useful when you want to directly access the raster data.</p>

<p>
The raw devices are <tt>bit bitrgb bitcmyk</tt>.

<h3><a name="Bounding_box_output"></a>Bounding box output</h3>

<p>
There is a special <b><tt>bbox</tt></b> "device" that just prints the
bounding box of each page.  You select it in the usual way:

<blockquote><b><tt>
gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox
</tt></b></blockquote>

<p>
It prints the output in a format like this:

<blockquote>
<pre><b><tt>%%BoundingBox: 14 37 570 719
%%HiResBoundingBox: 14.308066 37.547999 569.495061 718.319158
</tt></b></pre></blockquote>
<p></p>

<p>
Currently, it always prints the bounding box on <b><tt>stderr</tt></b>;
eventually, it should also recognize <b><tt>-sOutputFile=</tt></b>.

<p>
Note that this device, like other devices, has a resolution and a (maximum)
page size.  As for other devices, the product (resolution x page size) is
limited to approximately 500K pixels.  By default, the resolution is 4000
DPI and the maximum page size is approximately 125", or approximately 9000
default (1/72") user coordinate units.  If you need to measure larger pages
than this, you must reset <em>both</em> the resolution and the page size in
pixels, e.g.,

<blockquote><b><tt>
gs -dNOPAUSE -dBATCH -sDEVICE=bbox -r100 -g500000x500000
</tt></b></blockquote>


<h3><a name="Permute"></a>Permutation (DeviceN color model)</h3>

<p>
With no additional parameters, the device named "permute" looks
to Ghostscript like a standard CMYK contone device, and outputs a
PPM file, using a simple CMYK-&gt;RGB transform. This should be the
baseline for regression testing.

<p>
With the addition of <tt><b>-dPermute=1</b></tt>, the internal behavior changes
somewhat, but in most cases the resulting rendered file should be the
same. In this mode, the color model becomes "DeviceN" rather than
"DeviceCMYK", the number of components goes to six, and the color
model is considered to be the (yellow, cyan, cyan, magenta, 0, black)
tuple. This is what's rendered into the memory buffer. Finally, on
conversion to RGB for output, the colors are permuted back.

<p>
As such, this code should check that all imaging code paths are
64-bit clean. Additionally, it should find incorrect code that assumes
that the color model is one of DeviceGray, DeviceRGB, or DeviceCMYK.

<p>
Currently, the code has the limitation of 8-bit continuous tone
rendering only. An enhancement to do halftones is planned as well. Note,
however, that when testing permuted halftones for consistency, it is
important to permute the planes of the default halftone accordingly, and
that any file which sets halftones explicitly will fail a consistency
check.

<h3><a name="SPOT"></a>spotcmyk (DeviceN color model)</h3>

<p>
The <tt>spotcmyk</tt> device was created for debugging and testing of the DeviceN
extensions to Ghostscript that were released in version 8.0.
There are also another device (<tt>devicen</tt>) in the same
source file.  It were created for testing however it are not actually useful
except as example code.

<p>The <tt>spotcmyk</tt> device was also designed to provide example code for a
device which supports spot colors.
Spot colors need to be specified prior to opening the
first page.
This can be done via adding the
following to the command line: <b><tt>-c "<< /SeparationColorNames [ /Name1 /Name2 ]
>> setpagedevice" -f</tt></b>.

<p>
The <tt>spotcmyk</tt> device produces a binary data file (similar to the bitcmyk
device) for the CMYK data.  This data file has the name specified by the "OutputFile"
parameter.
The device also produces a binary data file (similar to the bitmono device)
for each spot color plane.
These data files have the name specified by the "OutputFile"
parameter with "sn" appended to the end (where "n" is the spot color number 0 to 12)".

<p>
After the <tt>spotcmyk</tt> device produces the binary data files, the files are read
and PCX format versions of these files are created with ".pcx" appended to the binary
source file name.

<p> If the the <tt>spotcmyk</tt> is being used with three spot colors and the 
"OutputFile" parameter is <tt>xxx</tt> then the following files would be created 
by the device:

<blockquote>
<pre>xxx - binary CMYK data
xxxs0 - binary data for first spot color
xxxs1 - binary data for second spot color
xxxs2 - binary data for third spot color
xxx.pcx - CMYK data in PCX format
xxxs0.pcx - first spot color in PCX format
xxxs1.pcx - second spot color in PCX format
xxxs2.pcx - third spot color in PCX format
</pre>
</blockquote>

<p>
The <tt>spotcmyk</tt> device has the creation of the binary data files separated
from the creation of the PCX files since the source file is intended as example
code and many people may not be interested in the PCX format. The PCX format was
chosen because it was simple to implement from preexisting code and viewers are
available.  The PCX format does have the disadvantage that most of those viewers
are on Windows.


<h3><a name="XCF"></a>XCF (DeviceN color model)</h3>

<p>
The XCF file format is the native image format for the GIMP program. This format
is currently supported by two devices: <tt> xcfrgb</tt> and <tt>xcfcmyk</tt>.

<blockquote><em>
We have been warned by the people supporting the GIMP program that they reserve
the right to change the
XCF format at anytime and thus these devices may become invalid. They are being
included in the documentation because we have received some questions about
these devices do.
</em></blockquote>

<p>
The XCF devices were created for testing of the DeviceN extensions to Ghostscript
which were released in version 8.0.

<p>
The <tt>xcfrgb</tt> device uses a DeviceRGB process color model and creates
a normal XCF file.

<p>
The <tt>xcfcmyk</tt> device was created as a means of viewing spot colors for
those users that do not have access to either Photoshop <a href=PSD">(see the PSD
devices)</a> or a PCX viewer <a href=SPOT">(see the <tt>spotcmyk</tt> device)</a>.

<p>
The <tt>xcfcmyk</tt> device starts by using a DeviceCMYK process color model. The
DeviceCMYK process color model allows the <tt>xcfcmyk</tt> device to also
support spot colors. Spot colors need to be specified prior to opening the
first page.
This can be done via adding the
following to the command line: <b><tt>-c "<< /SeparationColorNames [ /Name1 /Name2 ]
>> setpagedevice" -f</tt></b>.

<p>
After a page is complete, the <tt>xcfcmyk</tt> converts the CMYK image data into
RGB for storing in the XCF output file.  The XCF format does not currently
support CMYK data directly. The spot color planes are converted into alpha
channel planes. This is done because the XCF format does not currently support
spot colors.

</p>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996-2002 artofcode LLC.
All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</small></body>
</html>

pe load def
  /stringtype
	{dup rcheck
	  {(\() .p
	   {/.ch exch def
	    .ch 32 lt .ch 127 ge or
	    {(\\) .p .ch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>How to use the Ghostscript Dynamic Link Library (DLL)</title>
<!-- $Id: DLL.htm,v 1.33 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: dll.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>How to use the Ghostscript Dynamic Link Library (DLL)</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<ul>
<li><a href="#DLL">What is the Ghostscript DLL?</a>
<li><a href="#Common_functions">Platform-independent DLL functions</a>
<ul>
<li><a href="#revision"><b><tt>gsdll_revision()</tt></b></a>
<li><a href="#init"><b><tt>gsdll_init()</tt></b></a>
<li><a href="#execute_begin"><b><tt>gsdll_execute_begin()</tt></b></a>
<li><a href="#execute_cont"><b><tt>gsdll_execute_cont()</tt></b></a>
<li><a href="#execute_end"><b><tt>gsdll_execute_end()</tt></b></a>
<li><a href="#exit"><b><tt>gsdll_exit()</tt></b></a>
<li><a href="#lock_device"><b><tt>gsdll_lock_device()</tt></b></a>
</ul>
<li><a href="#Callback">Callback function</a>
<li><a href="#OS2_device">Ghostscript DLL device for OS/2</a>
<ul>
<li><a href="#OS2_bmp"><b><tt>gsdll_get_bitmap()</tt></b></a>
<li><a href="#OS2_example">Example DLL usage for OS/2</a>
</ul>
<li><a href="#Win_device">Ghostscript DLL device for MS Windows</a>
<ul>
<li><a href="#Win_copydib"><b><tt>gsdll_copy_dib()</tt></b></a>
<li><a href="#Win_copypalette"><b><tt>gsdll_copy_palette()</tt></b></a>
<li><a href="#Win_draw"><b><tt>gsdll_draw()</tt></b></a>
<li><a href="#Win_get_row"><b><tt>gsdll_get_bitmap_row()</tt></b></a>
</ul>
<li><a href="#Win16">Ghostscript DLL Device for 16-bit MS Windows</a>
</ul>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<p>
<b>WARNING: The API described in this document is obsolete and will
be removed in the future.</b> 
The current Ghostscript Interpreter API 
is described in <a href="API.htm">API.htm</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="DLL"></a>What is the Ghostscript DLL?</h2>

<p>
For the OS/2, Win16 and Win32 platforms, Ghostscript is built as a dynamic
link library (DLL), and to provide the interface described in the <a
href="Use.htm">usage documentation</a>, a smaller independent executable
(<b><tt>.EXE</tt></b>) loads this DLL, which provides all the interaction
with the windowing system, including image windows and, if necessary, a
text window.  This document describes the DLL interface, which consists of
eight main functions, <a href="#functions">seven platform-independent
ones</a> provided by the DLL and one, <a href="#Callback">the callback
function</a>, provided by the caller.  The DLL provides some other
platform-specific functions for display devices.

<p>
The DLL's name and characteristics differ among the three platforms:

<ul>
<li>The <a href="#OS2_device">OS/2 DLL <b><tt>GSDLL2.DLL</tt></b></a> has
MULTIPLE NONSHARED data segments and can be called by multiple programs
simultaneously.

<li>The <a href="#Win_device">Win32 DLL <b><tt>GSDLL32.DLL</tt></b></a> has
MULTIPLE NONSHARED data segments.  Under Win32s it can be used by only one
program at a time, but under Windows 95/98 or Windows NT it can be called by
multiple programs simultaneously.

<li>The <a href="#Win16">Win16 DLL <b><tt>GSDLL16.DLL</tt></b></a> is a
large-memory model DLL with far static data.  Due to the limitations of
16-bit MS Windows -- Windows 3.n -- the DLL can be used by only one program
at a time.
</ul>

<p>
The source for the executable is in <b><tt>dp</tt></b>*.* (OS/2) and
<b><tt>dw</tt></b>*.* (Windows).  See these source files for examples of
how to use the DLL.

<hr>

<h2><a name="Common_functions"></a>Platform-independent DLL functions</h2>

<p>
The seven functions provided by the DLL are
<ul>
<li><b><tt>int GSDLLAPI <a href="#revision">gsdll_revision</a>(char **product, char **copyright, long *gs_revision, long *gs_revisiondate)</tt></b>
<li><b><tt>int GSDLLAPI <a href="#init">gsdll_init</a>(GSDLL_CALLBACK callback, HWND hwnd, int argc, char *argv[]);</tt></b>
<li><b><tt>int GSDLLAPI <a href="#execute_begin">gsdll_execute_begin</a>(void);</tt></b>
<li><b><tt>int GSDLLAPI <a href="#execute_cont">gsdll_execute_cont</a>(const char *str, int len);</tt></b>
<li><b><tt>int GSDLLAPI <a href="#execute_end">gsdll_execute_end</a>(void);</tt></b>
<li><b><tt>int GSDLLAPI <a href="#exit">gsdll_exit</a>(void);</tt></b>
<li><b><tt>int GSDLLAPI <a href="#lock_device">gsdll_lock_device</a>(unsigned char *device, int flag);</tt></b>

<p>
where <b><tt>GSDLLAPI</tt></b> is defined under OS/2 as

<blockquote><b><tt>
#define GSDLLAPI
</tt></b></blockquote>

<p>
and under MS Windows as

<blockquote><b><tt>
#define GSDLLAPI CALLBACK _export
</tt></b></blockquote>
</ul>

<h3><a name="revision"></a><b><tt>gsdll_revision()</tt></b></h3>

<blockquote>
This function returns the revision numbers and strings of the Ghostscript
DLL; you should call it before <b><tt>gsdll_init()</tt></b> to make sure
that the correct version of the Ghostscript DLL has been loaded.  For
example

<blockquote>
<pre>char *product;
char *copyright;
long revision;
long revisiondate;
gsdll_revision(&amp;product, &amp;copyright, &amp;revision, &amp;revisiondate);
</pre></blockquote>

<p>
You may use <b><tt>NULL</tt></b> pointers if you do not want a particular
value.
</blockquote>

<h3><a name="init"></a><b><tt>gsdll_init()</tt></b></h3>

<blockquote>
<b><tt>gsdll_init()</tt></b> must be called after loading the DLL and
before executing any Ghostscript commands.  The arguments are the address
of the callback function, a parent window handle, the count of arguments
and an array of pointers to the arguments.  For example

<blockquote>
<pre>char *argv[5];
argv[0] = "gswin.exe";
argv[1] = "-Ic:\\gs;c:\gs\\fonts";
argv[2] = "-dNOPAUSE",
argv[3] = "-sDEVICE=djet500",
argv[4] = NULL;
argc = 4;

code = gsdll_init(gsdll_callback, hwnd, argc, argv);
</pre></blockquote>

<p>
<b><tt>hwnd</tt></b> is used as the parent window handle for any windows
created by Ghostscript.  <b><tt>hwnd</tt></b> may be <b><tt>NULL</tt></b>
if the caller has no windows, but if it is <b><tt>NULL</tt></b>, you should
avoid using devices which may open windows.

<p>
A return code of 0 (zero) indicates no errors, and the code may now call
<b><tt>gsdll_execute_begin()</tt></b> or <b><tt>gsdll_exit()</tt></b>.  If
the return value is non-zero then <b><tt>gsdll_exit()</tt></b> must not be
called.

<p>
A return value of <b><tt>GSDLL_INIT_QUIT</tt></b> indicates that one of the
command line files or arguments called "<b><tt>quit</tt></b>", or that
Ghostscript was reading stdin and reached end-of-file.  This is not an
error.  <b><tt>gsdll_exit()</tt></b> must not be called.

<p>
A return value of <b><tt>GSDLL_INIT_IN_USE</tt></b> indicates that the DLL
is in use by another application (Windows 3.1 only).  The DLL should be
immediately unloaded (or the caller terminated).
<b><tt>gsdll_exit()</tt></b> must not be called.
</blockquote>

<h3><a name="execute_begin"></a><b><tt>gsdll_execute_begin()</tt></b></h3>

<blockquote>
This must be called after <b><tt>gsdll_init()</tt></b> and before
<b><tt>gsdll_execute_cont()</tt></b>.
</blockquote>

<h3><a name="execute_cont"></a><b><tt>gsdll_execute_cont()</tt></b></h3>

<blockquote>
After successfully calling <b><tt>gsdll_init()</tt></b> and
<b><tt>gsdll_execute_begin()</tt></b>, commands may be given to Ghostscript
with <b><tt>gsdll_execute_cont()</tt></b>.  Examples are:

<blockquote>
<pre>char *command = "1 2 add == flush\n";
code = gsdll_execute_cont(command, strlen(command));
command = "qu"
code = gsdll_execute_cont(command, strlen(command));
command = "it\n"
code = gsdll_execute_cont(command, strlen(command));
</pre>

<a name="cont_returns"></a>
<table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Return codes from <b><tt>gsdll_execute_cont()</tt></b></font><hr>
<tr valign=bottom>
	<th align=left>Code
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<th align=left>Status
<tr>	<td colspan=3><hr>
<tr valign=top>	<td align=left>0
	<td>&nbsp;
	<td>No errors
<tr valign=top>	<td align=left>&lt; 0
	<td>&nbsp;
	<td>Error
<tr valign=top>	<td align=left>&lt;= -100
	<td>&nbsp;
	<td>"<b><tt>quit</tt></b>" has been executed, or fatal error.
<b><tt>gsdll_exit()</tt></b> must then be called: do not call
<b><tt>gsdll_execute_end()</tt></b>.
</table>
</blockquote>

<b><tt>gsdll_execute_cont()</tt></b>
does not flush stdio, so if you want to see output from Ghostscript you
must do this explicitly as shown in the example above.

<p>
When executing a string with <b><tt>gsdll_execute_cont()</tt></b>,
<b><tt>currentfile</tt></b> is the input from
<b><tt>gsdll_execute_cont()</tt></b>.  Reading from <b><tt>%stdin</tt></b>
uses the callback.

<p>
Please note that there is a 64 KB length limit on the passed string.
If you have more than 65535 bytes of input to process at a given time,
it must be split into separate smaller buffers, each passed on a 
separate call.

</blockquote>

<h3><a name="execute_end"></a><b><tt>gsdll_execute_end()</tt></b></h3>

<blockquote>
If <b><tt>gsdll_execute_cont()</tt></b> did not return an error, then
<b><tt>gsdll_execute_end()</tt></b> must be called after
<b><tt>gsdll_execute_cont()</tt></b> and before
<b><tt>gsdll_exit()</tt></b>.
</blockquote>

<h3><a name="exit"></a><b><tt>gsdll_exit()</tt></b></h3>

<blockquote>
Call gsdll_exit() to terminate the Ghostscript DLL.  It must be called if a
fatal error has occurred; see the <a href="#cont_returns">return value
of <b><tt>gsdll_execute_cont()</tt></b></a>.  After calling
<b><tt>gsdll_exit()</tt></b>, there are two options:

<ul>
<li>Unload the DLL, either by terminating the application or by
calling <b><tt>DosFreeModule</tt></b> (OS/2) or <b><tt>FreeLibrary</tt></b> (MS Windows).

<li>Call <b><tt>gsdll_init()</tt></b> again to restart Ghostscript.
</ul>
</blockquote>

<h3><a name="lock_device"></a><b><tt>gsdll_lock_device()</tt></b></h3>

<blockquote>
Since the caller may be multithreaded, a lock is needed to control access
to the display device, and <b><tt>gsdll_lock_device()</tt></b> provides that
locking.

<blockquote>
<pre>int gsdll_lock_device(unsigned char *device, int flag);
 /* Lock the device if flag = TRUE */
 /* Unlock the device if flag = FALSE */
 /* device is a pointer to Ghostscript os2dll or mswindll device */
 /* from GSDLL_DEVICE message. */
 /* Return value is the lock count. */
</pre>

<table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Locking and unlocking devices</font><hr>
<tr valign=top>	<td>To lock a device
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<td><b><tt>gsdll_lock_device(device, 1)</tt></b>;
<tr valign=top>	<td>To unlock a device
	<td>&nbsp;
	<td><b><tt>gsdll_lock_device(device, 0)</tt></b>;
</table>
</blockquote>

<p>
This function is typically used to lock the device while repainting a
window or copying the device bitmap to the clipboard.  Ghostscript may draw
into the device bitmap or update the palette entries while the device is
locked by the caller, but locking the device prevents the Ghostscript DLL
from closing the device or changing its size or depth.

<p>
Under OS/2, Windows 95/98 and Windows NT, this lock is implemented using a
mutual exclusion semaphore (mutex).  The return value is the lock count,
which is either 0 ("unlocked") or 1 ("locked").  The function blocks until
the device is locked by the caller.

<p>
Under Win16 or Win32s, <b><tt>gsdll_lock_device()</tt></b> always returns
immediately with a lock count as its return value.  A lock count of 2 or
more is definite indication of an error, probably calling the function
twice.  Access to the device should be controlled by checking the Windows
message queue only when the bitmap is not being accessed.
</blockquote>

<hr>

<h2><a name="Callback"></a>Callback function</h2>

<blockquote>
As an argument to <a href="#init"><b><tt>gsdll_init()</tt></b></a> the
caller must provide a callback function which the DLL invokes for stdio and
to notify the caller about device events.  The function provided by the
caller has this prototype:

<blockquote><b><tt>
int gsdll_callback(int&nbsp;message, char&nbsp;*str, unsigned&nbsp;long&nbsp;count);
</tt></b></blockquote>

<p>
The Pascal calling convention is not used.  An example callback function
is:

<blockquote>
<pre>int
gsdll_callback(int message, char *str, unsigned long count)
{
char *p;
    switch (message) {
        case GSDLL_STDIN:
            p = fgets(str, count, stdin);
            if (p)
                return strlen(str);
            else
                return 0;
        case GSDLL_STDOUT:
            if (str != (char *)NULL)
                fwrite(str, 1, count, stdout);
            return count;
        case GSDLL_DEVICE:
            fprintf(stdout,"Callback: DEVICE %p %s\n", str,
                count ? "open" : "close");
            break;
        case GSDLL_SYNC:
            fprintf(stdout,"Callback: SYNC %p\n", str);
            break;
        case GSDLL_PAGE:
            fprintf(stdout,"Callback: PAGE %p\n", str);
            break;
        case GSDLL_SIZE:
            fprintf(stdout,"Callback: SIZE %p width=%d height=%d\n", str,
                (int)(count &amp; 0xffff), (int)((count&gt;&gt;16) &amp; 0xffff) );
            break;
        case GSDLL_POLL:
            return 0; /* no error */
        default:
            fprintf(stdout,"Callback: Unknown message=%d\n",message);
            break;
    }
    return 0;
}
</pre>

<table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Messages used by callback</font><hr>
<tr valign=bottom>
	<th align=left>Symbol
	<td>&nbsp;&nbsp;
	<th align=left>
	<td>&nbsp;&nbsp;
	<th align=left>Use
<tr>	<td colspan=5><hr>
<tr valign=top>	<td><b><tt>GSDLL_STDIN</tt></b>
	<td>&nbsp;
	<td>1
	<td>&nbsp;
	<td>get <b><tt>count</tt></b> characters to <b><tt>str</tt></b> from stdin, return number of characters read
<tr valign=top>	<td><b><tt>GSDLL_STDOUT</tt></b>
	<td>&nbsp;
	<td>2
	<td>&nbsp;
	<td>put <b><tt>count</tt></b> characters from <b><tt>str</tt></b>
		to stdout, return number of characters written
<tr valign=top>	<td><b><tt>GSDLL_DEVICE</tt></b>
	<td>&nbsp;
	<td>3
	<td>&nbsp;
	<td>device <b><tt>str</tt></b> has been opened if
		<b><tt>count</tt></b>&nbsp;=&nbsp;1, closed if
		<b><tt>count</tt></b>&nbsp;=&nbsp;0
<tr valign=top>	<td><b><tt>GSDLL_SYNC</tt></b>
	<td>&nbsp;
	<td>4
	<td>&nbsp;
	<td>sync_output for device <b><tt>str</tt></b>
<tr valign=top>	<td><b><tt>GSDLL_PAGE</tt></b>
	<td>&nbsp;
	<td>5
	<td>&nbsp;
	<td>output_page for device <b><tt>str</tt></b>
<tr valign=top>	<td><b><tt>GSDLL_SIZE</tt></b>
	<td>&nbsp;
	<td>6
	<td>&nbsp;
	<td>resize for device <b><tt>str</tt></b>:
		LOWORD(<b><tt>count</tt></b>) is new <b><tt>xsize</tt></b>,
		HIWORD(<b><tt>count</tt></b>) is new <b><tt>ysize</tt></b>
<tr valign=top>	<td><b><tt>GSDLL_POLL</tt></b>
	<td>&nbsp;
	<td>7
	<td>&nbsp;
	<td>Called from <b><tt>gp_check_interrupt()</tt></b><br>
		Can be used by the caller to poll the message queue.
		Normally returns 0.  To abort
		<b><tt>gsdll_execute_cont()</tt></b>, return a non-zero
		error code until <b><tt>gsdll_execute_cont()</tt></b>
		returns.
</table>
</blockquote>
</blockquote>

<hr>

<h2><a name="OS2_device"></a>Ghostscript DLL device for OS/2</h2>

<p>
The <b><tt>os2dll</tt></b> device is provided in the Ghostscript DLL for
use by the caller.  No drawing facilities are provided by the DLL because
the DLL may be loaded by a text-only (non-PM) application.  The caller is
notified via the <b><tt>gsdll_callback()</tt></b> when a new
<b><tt>os2dll</tt></b> device is opened or closed
(<b><tt>GSDLL_DEVICE</tt></b>), when the window should be redrawn
(<b><tt>GSDLL_SYNC</tt></b> or <b><tt>GSDLL_PAGE</tt></b>) or when the
bitmap size changes (<b><tt>GSDLL_SIZE</tt></b>).
Note that more than one <b><tt>os2dll</tt></b> device may be opened.

<h3><a name="OS2_bmp"></a><b><tt>gsdll_get_bitmap()</tt></b></h3>

<blockquote>
<b><tt>gsdll_get_bitmap()</tt></b> returns a pointer to a bitmap in BMP
format.  The <b><tt>os2dll</tt></b> device draws into this bitmap.

<blockquote>
<pre>unsigned long gsdll_get_bitmap(unsigned char *device, unsigned char **pbitmap);
 /* return in pbitmap the address of the bitmap */
 /* device is a pointer to Ghostscript os2dll device from GSDLL_DEVICE message */
</pre></blockquote>

<p>
The caller can then display the bitmap however it likes, but should lock
the bitmap with <b><tt>gsdll_lock_device()</tt></b> before painting from
it, and unlock it afterwards.  The bitmap address does not change until the
<b><tt>os2dll</tt></b> device is closed; however the bitmap size and
palette may change whenever the bitmap is not locked.
</blockquote>

<h3><a name="OS2_example"></a>Example DLL usage for OS/2</h3>

<p>
The example here shows a minimal usage of the Ghostscript DLL under OS/2.
The sample callback function above is needed.

<blockquote>
<pre>#define INCL_DOS
#include &lt;os2.h&gt;
#include &lt;stdio.h&gt;
#include "gsdll.h"

PFN_gsdll_init pgsdll_init;
PFN_gsdll_execute_begin pgsdll_execute_begin;
PFN_gsdll_execute_cont pgsdll_execute_cont;
PFN_gsdll_execute_end pgsdll_execute_end;
PFN_gsdll_exit pgsdll_exit;

HMODULE hmodule_gsdll;
char buf[256];

int
main(int argc, char *argv[])
{
int code;
APIRET rc;
    if (!DosLoadModule(buf, sizeof(buf), "GSDLL2", &amp;hmodule_gsdll)) {
        fprintf(stderr, "Loaded GSDLL2\n");
        DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_init", (PFN *)(&amp;pgsdll_init));
        DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_execute_begin", (PFN *)(&amp;pgsdll_execute_begin));
        DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_execute_cont", (PFN *)(&amp;pgsdll_execute_cont));
        DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_execute_end", (PFN *)(&amp;pgsdll_execute_end));
        DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_exit", (PFN *)(&amp;pgsdll_exit));
    }
    else {
        fprintf(stderr, "Can't load GSDLL2\n");
    }

    code = (*pgsdll_init)(gsdll_callback, NULL, argc, argv);
    fprintf(stdout,"gsdll_init returns %d\n", code);
    code = (*pgsdll_execute_begin)();
    if (code==0) {
        while (fgets(buf, sizeof(buf), stdin)) {
            code = (*pgsdll_execute_cont)(buf, strlen(buf));
            fprintf(stdout,"gsdll_execute returns %d\n", code);
            if (code &lt; 0)
               break;
        }
        if (!code)
            code = (*pgsdll_execute_end)();
        code = (*pgsdll_exit)();
        fprintf(stdout,"gsdll_exit returns %d\n", code);
    }
    rc = DosFreeModule(hmodule_gsdll);
    fprintf(stdout,"DosFreeModule returns %d\n", rc);
    return 0;
}
</pre></blockquote>

<hr>

<h2><a name="Win_device"></a>Ghostscript DLL device for MS Windows</h2>

<p>
The <b><tt>mswindll</tt></b> device is provided in the Ghostscript DLL for
use by the caller.  The caller is notified via the
<b><tt>gsdll_callback()</tt></b> when a new <b><tt>mswindll</tt></b> device
is opened or closed (<b><tt>GSDLL_DEVICE</tt></b>), when the window should
be redrawn (<b><tt>GSDLL_SYNC</tt></b> or <b><tt>GSDLL_PAGE</tt></b>) or
when the bitmap size changes (<b><tt>GSDLL_SIZE</tt></b>).  Note that more
than one <b><tt>mswindll</tt></b> device may be opened.

<p>
Four DLL functions are available to use the <b><tt>mswindll</tt></b>
device.

<h3><a name="Win_copydib"></a><b><tt>gsdll_copy_dib()</tt></b></h3>

<blockquote>
Copy the <b><tt>mswindll</tt></b> bitmap to the clipboard.

<blockquote>
<pre>HGLOBAL GSDLLAPI gsdll_copy_dib(unsigned char *device);
 /* make a copy of the device bitmap and return shared memory handle to it */
 /* device is a pointer to Ghostscript device from GSDLL_DEVICE message */
</pre></blockquote>
</blockquote>

<h3><a name="Win_copypalette"></a><b><tt>gsdll_copy_palette()</tt></b></h3>

<blockquote>
Copy the <b><tt>mswindll</tt></b> palette to the clipboard.

<blockquote>
<pre>HPALETTE GSDLLAPI gsdll_copy_palette(unsigned char *device);
/* make a copy of the device palette and return a handle to it */
/* device is a pointer to Ghostscript device from GSDLL_DEVICE message */
</pre></blockquote>
</blockquote>

<h3><a name="Win_draw"></a><b><tt>gsdll_draw()</tt></b></h3>

<blockquote>
Display output from the <b><tt>mswindll</tt></b> device.  The caller should
create a window and call <b><tt>gsdll_draw()</tt></b> in response to the
<b><tt>WM_PAINT</tt></b> message.  The device context <b><tt>hdc</tt></b>
must be for a device because <b><tt>SetDIBitsToDevice()</tt></b> is used.

<blockquote>
<pre>void GSDLLAPI gsdll_draw(unsigned char *device, HDC hdc,
                                  LPRECT dest, LPRECT src);
/* copy the rectangle src from the device bitmap */
/* to the rectangle dest on the device given by hdc */
/* hdc must be a device context for a device (NOT a bitmap) */
/* device is a pointer to Ghostscript device from GSDLL_DEVICE message */
</pre></blockquote>
</blockquote>

<h3><a name="Win_get_row"></a><b><tt>gsdll_get_bitmap_row()</tt></b></h3>

<blockquote>
Get a BMP header, a palette, and a pointer to a row in the bitmap.  This
function exists to allow the bitmap to be copied to a file or structured
storage without the overhead of having two copies of the bitmap in memory
at the same time.

<p>
Ghostscript can change the palette while the device is locked.  Do not call
this function while Ghostscript is busy.

<blockquote>
<pre>int GSDLLAPI gsdll_get_bitmap_row(unsigned char *device, LPBITMAPINFOHEADER pbmih,
    LPRGBQUAD prgbquad, LPBYTE *ppbyte, unsigned int row)
/* If pbmih nonzero, copy the BITMAPINFOHEADER.
 * If prgbquad nonzero, copy the palette.
 *   number of entries copied is given by pbmih-&gt;biClrUsed
 * If ppbyte nonzero, return pointer to row.
 *   pointer is only valid while device is locked
 */
</pre></blockquote>
</blockquote>

<hr>

<h2><a name="Win16"></a>Ghostscript DLL Device for 16-bit MS Windows</h2>

<p>
This platform has the most problems of the three.  Support for it may be
dropped in future.

<p>
The Win16 DLL <b><tt>GSDLL16.DLL</tt></b> is a large-memory model DLL with
far static data.  Due to the limitations of 16-bit MS Windows, the DLL can
be used by only one program at a time.

<p>
However, <b><tt>GSDLL16</tt></b> is marked as having SINGLE SHARED data
segments, allowing multiple applications to load it with no error
indication.  (The DLL wouldn't load at all if MULTIPLE NONSHARED was used).
Nonetheless, <b>it cannot be used by more than one application at a
time</b>, so applications loading <b><tt>GSDLL16</tt></b> should check the
return value of <b><tt>gsdll_init()</tt></b>: if this value is non-zero,
then <b><tt>GSDLL16</tt></b> is already in use by another application and
should <b><em>not</em></b> be used: <b><tt>GSDLL16</tt></b> should be
unloaded immediately using <b><tt>FreeLibrary()</tt></b>, or the calling
program should quit without attempting to use the library..

<p>
The segmented architecture of the Intel 80286 causes the usual amount of
grief when using <b><tt>GSDLL16</tt></b>.  Because the callback is called
from the DLL, which is using a different data segment, the callback must be
declared as <b><tt>_far&nbsp;_export</tt></b>:

<blockquote>
<pre>int _far _export gsdll_callback(int message, char *str, unsigned long count);
</pre></blockquote>

<p>
Instead of giving <b><tt>gsdll_init()</tt></b> the address of
<b><tt>gsdll_callback()</tt></b>, it should instead be given the address of
a thunk created by <b><tt>MakeProcInstance</tt></b>.  This thunk changes
the data segment back to that used by the caller:

<blockquote>
<pre>FARPROC lpfnCallback;
lpfnCallback = (FARPROC)MakeProcInstance((FARPROC)gsdll_callback, hInstance);
code = (*pgsdll_init)((GSDLL_CALLBACK)lpfnCallback, NULL, argc, argv);
if (!code) {
    fprintf(stderr, "GSDLL16 is already in use\n");
    return -1;
}
</pre></blockquote>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996, 1997, 1998 Aladdin Enterprises.
All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
bal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>The interface between Ghostscript and device drivers</title>
<!-- $Id: Drivers.htm,v 1.43 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: drivers.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>The interface between Ghostscript and device drivers</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Adding_drivers">Adding a driver</a>
<li><a href="#KISS">Keeping things simple</a>
<li><a href="#Structure">Driver structure</a>
<ul>
<li><a href="#Structure_definition">Structure definition</a>
<li><a href="#Sophisticated">For sophisticated developers only</a>
</ul>
<li><a href="#coordinates_and_types">Coordinates and types</a>
<ul>
<li><a href="#Coordinate_system">Coordinate system</a>
<li><a href="#Color_definition">Color definition</a>
<ul>
<li><a href="#sep_and_linear_fields">Separable and linear fields</a>
<li><a href="#Changing_color_info_data">Changing color_info data</a>           
</ul>
<li><a href="#Types">Types</a>
</ul>
<li><a href="#Coding_conventions">Coding conventions</a>
<ul>
<li><a href="#Allocating_storage">Allocating storage</a>
<li><a href="#Driver_instance_allocation">Driver instance allocation</a>
</ul>
<li><a href="#Printer_drivers">Printer drivers</a>
<li><a href="#Driver_procedures">Driver procedures</a>
<ul>
<li><a href="#Life_cycle">Life cycle</a>
<li><a href="#Open_close">Open, close, sync, copy</a>
<li><a href="#Color_mapping">Color and alpha mapping</a>
<li><a href="#Pixel_level_drawing">Pixel-level drawing</a>
<ul>
<li><a href="#Bitmap_imaging">Bitmap imaging</a>
<li><a href="#Pixmap_imaging">Pixmap imaging</a>
<li><a href="#Compositing">Compositing</a>
  [<a href="#S_spec">S</a>, <a href="#T_spec">T</a>, <a href="#F_spec">f</a>,
   <a href="#Compositing_notes">Notes</a>]
</ul>
<li><a href="#Polygon_level_drawing">Polygon-level drawing</a>
<li><a href="#High_level_drawing">High-level drawing</a>
<ul>
<li><a href="#Paths">Paths</a>
<li><a href="#Images">Images</a> [<a href="#Images_notes">Notes</a>]
<li><a href="#Text">Text</a> [<a href="#Text_notes">Notes</a>]
</ul>
<li><a href="#Reading_bits_back">Reading bits back</a>
<li><a href="#Parameters">Parameters</a>
<ul>
<li><a href="#Default_CRD_parameters">Default color rendering dictionary (CRD) parameters</a>
</ul>
<li><a href="#External_fonts">External fonts</a>
<li><a href="#Page_devices">Page devices</a>
<li><a href="#Miscellaneous">Miscellaneous</a>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a> and the documentation on <a href="Make.htm">how to build
Ghostscript</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="Adding_drivers"></a>Adding a driver</h2>

<p>
To add a driver to Ghostscript, first pick a name for your device, say
"<b><tt>smurf</tt></b>".  (Device names must be 1 to 8 characters, begin
with a letter, and consist only of letters, digits, and underscores.  Case
is significant: all current device names are lower case.)  Then all you
need do is edit <b><tt>contrib.mak</tt></b> in two places.

<ol>
<li>The list of devices, in the section headed "Catalog".  Add
<b><tt>smurf</tt></b> to the list.

<li>The section headed "Device drivers".

<p>
Suppose the files containing the smurf driver are called
"<b><tt>joe</tt></b>" and "<b><tt>fred</tt></b>".  Then you should add the
following lines:

<blockquote>
<pre># ------ The SMURF device ------ #

smurf_=$(GLOBJ)joe.$(OBJ) $(GLOBJ)fred.$(OBJ)
$(DD)smurf.dev: $(smurf_)
        $(SETDEV) $(DD)smurf $(smurf_)

$(GLOBJ)joe.$(OBJ) : $(GLSRC)joe.c
	$(GLCC) $(GLO_)joe.$(OBJ) $(C_) $(GLSRC)joe.c

$(GLOBJ)fred.$(OBJ) : $(GLSRC)fred.c
	$(GLCC) $(GLO_)fred.$(OBJ) $(C_) $(GLSRC)fred.c</pre>
</blockquote>

<p>
and whatever <b><tt>joe.c</tt></b> and <b><tt>fred.c</tt></b> depend on.
If the smurf driver also needs special libraries, for instance a library
named "<b><tt>gorf</tt></b>", then the entry should look like this:

<blockquote>
<pre>$(DD)smurf.dev : $(smurf_)
        $(SETDEV) $(DD)smurf $(smurf_)
        $(ADDMOD) $(DD)smurf -lib gorf</pre>
</blockquote>

<p>
If, as will usually be the case, your driver is a printer driver (as
<a href="#Printer_drivers">discussed below</a>), the device entry should
look like this:

<blockquote>
<pre>$(DD)smurf.dev : $(smurf_) $(GLD)page.dev
        $(SETPDEV) $(DD)smurf $(smurf_)</pre>
</blockquote>

<p>
or

<blockquote>
<pre>$(DD)smurf.dev : $(smurf_) $(GLD)page.dev
        $(SETPDEV) $(DD)smurf $(smurf_)
        $(ADDMOD) $(DD)smurf -lib gorf</pre>
</blockquote>

<p>
Note that the space before the :, and the explicit compilation rules for the
.c files, are required for portability,
</ol>

<hr>

<h2><a name="KISS"></a>Keeping things simple</h2>

<p>
If you want to add a simple device (specifically, a monochrome printer), you
probably don't need to read the rest of this document; just use the code in
an existing driver as a guide.  The Epson and Canon BubbleJet drivers <a
href="../src/gdevepsn.c">gdevepsn.c</a> and <a
href="../src/gdevbj10.c">gdevbj10.c</a> are good models for dot-matrix
printers, which require presenting the data for many scan lines at once; the
DeskJet/LaserJet drivers in <a href="../src/gdevdjet.c">gdevdjet.c</a> are
good models for laser printers, which take a single scan line at a time but
support data compression.  For color printers, there are unfortunately no
good models: the two major color inkjet printer drivers, <a
href="../src/gdevcdj.c">gdevcdj.c</a> and <a
href="../src/gdevstc.c">gdevstc.c</a>, are far too complex to read.

<p>
On the other hand, if you're writing a driver for some more esoteric
device, you probably do need at least some of the information in the rest
of this document.  It might be a good idea for you to read it in
conjunction with one of the existing drivers.

<p>
Duplication of code, and sheer volume of code, is a serious maintenance and
distribution problem for Ghostscript.  If your device is similar to an
existing one, try to implement your driver by adding some parameterization
to an existing driver rather than by copying code to create an entirely new
source module.  <a href="../src/gdevepsn.c">gdevepsn.c</a> and <a
href="../src/gdevdjet.c">gdevdjet.c</a> are good examples of this approach.

<hr>

<h2><a name="Structure"></a>Driver structure</h2>

<p>
A device is represented by a structure divided into three parts:

<ul>
<li>procedures that are (normally) shared by all instances of each device;

<li>parameters that are present in all devices but may be different for
each device or instance; and

<li>device-specific parameters that may be different for each instance.
</ul>

<p>
Normally the procedure structure is defined and initialized at compile
time.  A prototype of the parameter structure (including both generic and
device-specific parameters) is defined and initialized at compile time, but
is copied and filled in when an instance of the device is created.  Both of
these structures should be declared as <b><tt>const</tt></b>, but for backward
compatibility reasons the latter is not.

<p>
The <b><tt>gx_device_common</tt></b> macro defines the common structure
elements, with the intent that devices define and export a structure along
the following lines.  Do not fill in the individual generic parameter values
in the usual way for C structures: use the macros defined for this purpose
in <a href="../src/gxdevice.h">gxdevice.h</a> or, if applicable, <a
href="../src/gdevprn.h">gdevprn.h</a>.

<blockquote>
<pre>typedef struct smurf_device_s {
        gx_device_common;
        <b><em>... device-specific parameters ...</em></b>
} smurf_device;
smurf_device gs_smurf_device = {
        <b><em>... macro for generic parameter values ...,</em></b>
        { <b><em>... procedures ...</em></b> },         /* std_procs */
        <b><em>... device-specific parameter values if any ...</em></b>
};</pre>
</blockquote>
<p>
The device structure instance <b>must</b> have the name
<b><tt>gs_smurf_device</tt></b>, where <b><tt>smurf</tt></b> is the device
name used in <b><tt>contrib.mak</tt></b>.  <b><tt>gx_device_common</tt></b>
is a macro consisting only of the element definitions. 
<p>
All the device procedures are called with the device as the first argument.
Since each device type is actually a different structure type, the device
procedures must be declared as taking a <b><tt>gx_device&nbsp;*</tt></b> as
their first argument, and must cast it to
<b><tt>smurf_device&nbsp;*</tt></b> internally.  For example, in the code
for the "memory" device, the first argument to all routines is called
<b><tt>dev</tt></b>, but the routines actually use <b><tt>mdev</tt></b> to
refer to elements of the full structure, using the following standard
initialization statement at the beginning of each procedure:

<blockquote>
<pre>gx_memory_device *const mdev = (gx_device_memory *)dev;</pre>
</blockquote>

<p>
(This is a cheap version of "object-oriented" programming: in C++, for
example, the cast would be unnecessary, and in fact the procedure table
would be constructed by the compiler.)

<h3><a name="Structure_definition"></a>Structure definition</h3>

<p>
You should consult the definition of struct <b><tt>gx_device_s</tt></b> in
<a href="../src/gxdevice.h">gxdevice.h</a> for the complete details of the
generic device structure.  Some of the most important members of this
structure for ordinary drivers are:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><b><tt>const char *dname;</tt></b>
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<td>The device name
<tr valign=top>	<td><b><tt>bool is_open;</tt></b>
	<td>&nbsp;
	<td>True if device has been opened
<tr valign=top>	<td><b><tt>gx_device_color_info color_info;</tt></b>
	<td>&nbsp;
	<td>Color information
<tr valign=top>	<td><b><tt>int width;</tt></b>
	<td>&nbsp;
	<td>Width in pixels
<tr valign=top>	<td><b><tt>int height;</tt></b>
	<td>&nbsp;
	<td>Height in pixels
</table></blockquote>

<p>
The name in the structure (<b><tt>dname</tt></b>) should be the same as the
name in <a href="../src/contrib.mak">contrib.mak</a>.

<h3><a name="Sophisticated"></a>For sophisticated developers only</h3>

<p>
If for any reason you need to change the definition of the basic device
structure, or to add procedures, you must change the following places:

<blockquote><ul>
<li>This document and the <a href="News.htm">news document</a> (if you want
	to keep the documentation up to date).
<li>The definition of <b><tt>gx_device_common</tt></b> and the procedures
	in <a href="../src/gxdevcli.h">gxdevcli.h</a>.
<li>Possibly, the default forwarding procedures declared in
	<a href="../src/gxdevice.h">gxdevice.h</a> and implemented in
	<a href="../src/gdevnfwd.c">gdevnfwd.c</a>.
<li>The device procedure record completion routines in
	<a href="../src/gdevdflt.c">gdevdflt.c</a>.
<li>Possibly, the default device implementation in
	<a href="../src/gdevdflt.c">gdevdflt.c</a>,
	<a href="../src/gdevddrw.c">gdevddrw.c</a>, and
	<a href="../src/gxcmap.c">gxcmap.c</a>.
<li>The bounding box device in <a href="../src/gdevbbox.c">gdevbbox.c</a>
	(probably just adding <b><tt>NULL</tt></b> procedure entries if the
	new procedures don't produce output).
<li>These devices that must have complete (non-defaulted) procedure vectors:
<ul>
<li>The null device in <a href="../src/gdevnfwd.c">gdevnfwd.c</a>.
<li>The command list "device" in <a href="../src/gxclist.c">gxclist.c</a>.
	This is not an actual device; it only defines procedures.
<li>The "memory" devices in <a href="../src/gdevmem.h">gdevmem.h</a> and
	<b><tt>gdevm*.c</tt></b>.
</ul>
<li>The clip list accumulation "device" in
	<a href="../src/gxacpath.c">gxacpath.c</a>.
<li>The clipping "devices" <a href="../src/gxclip.c">gxclip.c</a>,
	<a href="../src/gxclip2.c">gxclip2.c</a>,
	and <a href="../src/gxclipm.c">gxclipm.c</a>.
<li>The pattern accumulation "device" in
	<a href="../src/gxpcmap.c">gxpcmap.c</a>.
<li>The hit detection "device" in <a href="../src/gdevhit.c">gdevhit.c</a>.
<li>The generic printer device macros in
	<a href="../src/gdevprn.h">gdevprn.h</a>.
<li>The generic printer device code in
	<a href="../src/gdevprn.c">gdevprn.c</a>.
<li>The RasterOp source device in
	<a href="../src/gdevrops.c">gdevrops.c</a>.
</ul></blockquote>

<p>
You may also have to change the code for
<b><tt>gx_default_get_params</tt></b> or
<b><tt>gx_default_put_params</tt></b> in <a
href="../src/gsdparam.c">gsdparam.c</a>.

<p>
You should not have to change any of the real devices in the standard
Ghostscript distribution (listed in <a href="../src/devs.mak">devs.mak</a>
and <a href="../src/contrib.mak">contrib.mak</a>) or any of your own
devices, because all of them are supposed to use the macros in <a
href="../src/gxdevice.h">gxdevice.h</a> or <a
href="../src/gdevprn.h">gdevprn.h</a> to define and initialize their state.

<hr>

<h2><a name="coordinates_and_types"></a>Coordinates and types</h2>

<h3><a name="Coordinate_system"></a>Coordinate system</h3>

<p>
Since each driver specifies the initial transformation from user
coordinates to device coordinates, the driver can use any coordinate system
it wants, as long as a device coordinate will fit in an
<b><tt>int</tt></b>.  (This is only an issue on DOS systems, where ints are
only 16 bits.  User coordinates are represented as floats.)  Most current
drivers use a coordinate system with (0,0) in the upper left corner, with
<b><em>X</em></b> increasing to the right and <b><em>Y</em></b> increasing
toward the bottom.  However, there is supposed to be nothing in the rest of
Ghostscript that assumes this, and indeed some drivers use a coordinate
system with (0,0) in the lower left corner.

<p>
Drivers must check (and, if necessary, clip) the coordinate parameters given
to them: they should not assume the coordinates will be in bounds.  The
<b><tt>fit_fill</tt></b> and <b><tt>fit_copy</tt></b> macros in <a
href="../src/gxdevice.h">gxdevice.h</a> are very helpful in doing this.

<h3><a name="Color_definition"></a>Color definition</h3>

<p>
Between the Ghostscript graphics library and the device, colors are
represented in three forms. Color components in a color space (Gray, RGB,
DeviceN, etc.) represented as <b><tt>frac</tt></b> values. Device colorants
are represented as <b><tt>gx_color_value</tt></b> values.  For many
procedures, colors are represented in a type called
<b><tt>gx_color_index</tt></b>.
All three types are described in more detail in <a href="#Types">Types</a>

<p>
The <b><tt>color_info</tt></b> member of the device structure defines the
color and gray-scale capabilities of the device.  Its type is defined as
follows:

<blockquote>
<pre>
/*
 * The enlarged color model information structure: Some of the
 * information that was implicit in the component number in
 * the earlier conventions (component names, polarity, mapping
 * functions) are now explicitly provided.
 *
 * Also included is some information regarding the encoding of
 * color information into gx_color_index. Some of this information
 * was previously gathered indirectly from the mapping
 * functions in the existing code, specifically to speed up the
 * halftoned color rendering operator (see
 * gx_dc_ht_colored_fill_rectangle in gxcht.c). The information
 * is now provided explicitly because such optimizations are
 * more critical when the number of color components is large.
 *
 * Note: no pointers have been added to this structure, so there
 *       is no requirement for a structure descriptor.
 */
typedef struct gx_device_color_info_s {

    /*
     * max_components is the maximum number of components for all
     * color models supported by this device. This does not include
     * any alpha components.
     */
    int max_components;

    /*
     * The number of color components. This does not include any
     * alpha-channel information, which may be integrated into
     * the gx_color_index but is otherwise passed as a separate
     * component.
     */
    int num_components;

    /*
     * Polarity of the components of the color space, either
     * additive or subtractive. This is used to interpret transfer
     * functions and halftone threshold arrays. Possible values
     * are GX_CM_POLARITY_ADDITIVE or GX_CM_POLARITY_SUBTRACTIVE
     */
    gx_color_polarity_t polarity;

    /*
     * The number of bits of gx_color_index actually used. 
     * This must be <= sizeof(gx_color_index), which is usually 64.
     */
    byte depth;

    /*
     * Index of the gray color component, if any. The max_gray and
     * dither_gray values apply to this component only; all other
     * components use the max_color and dither_color values.
     *
     * This will be GX_CINFO_COMP_NO_INDEX if there is no gray 
     * component.
     */
    byte gray_index;

    /*
     * max_gray and max_color are the number of distinct native
     * intensity levels, less 1, for the gray and all other color
     * components, respectively. For nearly all current devices
     * that support both gray and non-gray components, the two
     * parameters have the same value.
     *
     * dither_grays and dither_colors are the number of intensity
     * levels between which halftoning can occur, for the gray and
     * all other color components, respectively. This is
     * essentially redundant information: in all reasonable cases,
     * dither_grays = max_gray + 1 and dither_colors = max_color + 1.
     * These parameters are, however, extensively used in the
     * current code, and thus have been retained.
     *
     * Note that the non-gray values may now be relevant even if
     * num_components == 1. This simplifies the handling of devices
     * with configurable color models which may be set for a single
     * non-gray color model.
     */
    gx_color_value max_gray;	/* # of distinct color levels -1 */
    gx_color_value max_color;

    gx_color_value dither_grays;
    gx_color_value dither_colors;

    /*
     * Information to control super-sampling of objects to support
     * anti-aliasing.
     */
    gx_device_anti_alias_info anti_alias;

    /*
     * Flag to indicate if gx_color_index for this device may be divided
     * into individual fields for each component. This is almost always
     * the case for printers, and is the case for most modern displays
     * as well. When this is the case, halftoning may be performed
     * separately for each component, which greatly simplifies processing
     * when the number of color components is large.
     *
     * If the gx_color_index is separable in this manner, the comp_shift
     * array provides the location of the low-order bit for each
     * component. This may be filled in by the client, but need not be.
     * If it is not provided, it will be calculated based on the values
     * in the max_gray and max_color fields as follows:
     *
     *     comp_shift[num_components - 1] = 0,
     *     comp_shift[i] = comp_shift[i + 1]
     *                      + ( i == gray_index ? ceil(log2(max_gray + 1))
     *                                          : ceil(log2(max_color + 1)) )
     *
     * The comp_mask and comp_bits fields should be left empty by the client.
     * They will be filled in during initialization using the following
     * mechanism:
     *
     *     comp_bits[i] = ( i == gray_index ? ceil(log2(max_gray + 1))
     *                                      : ceil(log2(max_color + 1)) )
     *
     *     comp_mask[i] = (((gx_color_index)1 << comp_bits[i]) - 1)
     *                       << comp_shift[i]
     *
     * (For current devices, it is almost always the case that
     * max_gray == max_color, if the color model contains both gray and
     * non-gray components.)
     *
     * If separable_and_linear is not set, the data in the other fields
     * is unpredictable and should be ignored.
     */
    gx_color_enc_sep_lin_t separable_and_linear;
    byte                   comp_shift[GX_DEVICE_COLOR_MAX_COMPONENTS];
    byte                   comp_bits[GX_DEVICE_COLOR_MAX_COMPONENTS];
    gx_color_index         comp_mask[GX_DEVICE_COLOR_MAX_COMPONENTS];
    /*
     * Pointer to name for the process color model.
     */
    const char * cm_name;

} gx_device_color_info;
</pre>
</blockquote>

<p>
Note: See <a href="#Changing_color_info_data">Changing color_info data</a> before changing
any information in the <b><tt>color_info structure</tt></b> for a device.           

<p>
It is recommended that the values for this structure be defined using one
of the standard macros provided for this purpose. This allows for future
changes to be made to the structure without changes being required in the
actual device code.

<p>
The following macros (in <a href="../src/gxdevcli.h">gxdevcli.h</a>) provide
convenient shorthands for initializing this structure for ordinary
black-and-white or color devices:

<blockquote>
<b><tt>#define dci_black_and_white</tt></b> ...<br>
<b><tt>#define dci_color(depth,maxv,dither)</tt></b> ...
</blockquote>

<p>
The <b><tt>#define dci_black_and_white</tt></b> macro defines a
single bit monochrome device (For example: a typical monochrome printer device.)

<p>
The <b><tt>#define dci_color(depth,maxv,dither)</tt></b> macro can be used
to define a 24 bit RGB device or a 4 or 32 bit CMYK device.

<p>
The <b><tt>#define dci_extended_alpha_values</tt></b> macro (in
<a href="../src/gxdevcli.h">gxdevcli.h</a>) 
specifies most of the current fields in the structure. However this macro allows 
only the default setting for the comp_shift, comp_bits, and comp_mask fields 
to be set. Any device which requires a non-default setting for these fields 
has to correctly these fields during the device open procedure.
See 
<a href="#sep_and_linear_fields">Separable and linear fields></a> and
<a href="#Changing_color_info_data">Changing color_info data</a>.

<p>
The idea is that a device has a certain number of gray levels
(<b><tt>max_gray</tt></b>+1) and a certain number of colors
(<b><tt>max_rgb</tt></b>+1) that it can produce directly.  When Ghostscript
wants to render a given color space color value as a device color, it first tests
whether the color is a gray level and if so:

<blockquote>
If <b><tt>max_gray</tt></b> is large (&gt;= 31), Ghostscript asks the
device to approximate the gray level directly.  If the device returns a
valid <b><tt>gx_color_index</tt></b>, Ghostscript uses it.  Otherwise,
Ghostscript assumes that the device can represent
<b><tt>dither_gray</tt></b> distinct gray levels, equally spaced along the
diagonal of the color cube, and uses the two nearest ones to the desired
color for halftoning.
</blockquote>

<p>
If the color is not a gray level:

<blockquote>
If <b><tt>max_rgb</tt></b> is large (&gt;= 31), Ghostscript asks the device
to approximate the color directly.  If the device returns a valid
<b><tt>gx_color_index</tt></b>, Ghostscript uses it.  Otherwise,
Ghostscript assumes that the device can represent

<blockquote>
<b><tt>dither_rgb</tt></b> &times; <b><tt>dither_rgb</tt></b> &times; <b><tt>dither_rgb</tt></b>
</blockquote>

<p>
distinct colors, equally spaced throughout the color cube, and uses two of
the nearest ones to the desired color for halftoning.
</blockquote>

<h4><a name="sep_and_linear_fields"></a>Separable and linear fields</h4>
<p>
The three fields <b><tt>comp_shift</tt></b>, <b><tt>comp_bits</tt></b>, and 
<b><tt>comp_mask</tt></b> are only used if the <b><tt>separable_and_linear</tt></b> 
field is set to <b><tt>GX_CINFO_SEP_LIN</tt></b>. In this situation a <b><tt>gx_color_index</tt></b> 
value must represent a combination created by or'ing bits for each of the devices's 
output colorants. The <b><tt>comp_shift</tt></b> array defines the location 
(shift count) of each colorants bits in the output gx_color_index value. The 
<b><tt>comp_bits</tt></b> array defines the number of bits for each colorant. 
The <b><tt>comp_mask</tt></b> array contains a mask which can be used to isolate 
the bits for each colorant. These fields must be set if the device supports 
more than four colorants.

<h4><a name="Changing_color_info_data"></a>Changing color_info data</h4>

<p> For most devices, the information in the device's <tt><b>color_info</b></tt> 
structure is defined by the various device definition macros and the data remains 
constant during the entire existence of the device. In general the Ghostscript 
graphics assumes that the information is constant. However some devices want 
to modify the data in this structure.

<p>
The device's <b><tt>put_params</tt></b> procedure may change
<b><tt>color_info</tt></b> field values.
After the data has been modified then the 
device should be closed (via a call to <tt><b>gs_closedevice</b></tt>). Closing
the device will erase the current page so these changes should only be made
before anything has been drawn on a page.

<p> The device's <tt><b>open_device</b></tt> procedure may change
<b><tt>color_info</tt></b> field values. These changes should be done before
calling any other procedures are called.

<p>
The Ghostscript graphics library
uses some of the data in <b><tt>color_info</tt></b> to set the default
procedures for the 
<b><tt>get_color_mapping_procs</tt></b>,
<b><tt>get_color_comp_index</tt></b>,
<b><tt>encode_color</tt></b>, and
<b><tt>decode_color</tt></b> procedures.
These default procedures are set when the
device is originally created. If any changes are made to the
<b><tt>color_info</tt></b> fields then the device's <b><tt>open_device</tt></b>
procedure
has responsibility for insuring that the correct procedures are contained
in the device structure. (For an example, see the display device open procedure
<b><tt>display_open</tt></b> and its subroutine <b><tt>display_set_color_format
</tt></b> (in <a href="../src/gdevdisp.c">gdevdisp</a>).


<h3><a name="Types"></a>Types</h3>

<p>
Here is a brief explanation of the various types that appear as parameters
or results of the drivers.

<dl>
<dt><b><tt>frac</tt></b> (defined in <a href="../src/gxfrac.h">gxfrac.h</a>)
<dd>This is the type used to represent color values for the input to the
color model mapping procedures. It is currently defined as a short.  It has a
range of <b><tt>frac_0</tt></b> to <b><tt>frac_1</tt></b>.
</dl>

<dl>
<dt><b><tt>gx_color_value</tt></b> (defined in
<a href="../src/gxdevice.h">gxdevice.h</a>)
<dd>This is the type used to represent RGB or CMYK color values.  It is
currently equivalent to unsigned short.  However, Ghostscript may use less
than the full range of the type to represent color values:
<b><tt>gx_color_value_bits</tt></b> is the number of bits actually used,
and <b><tt>gx_max_color_value</tt></b> is the maximum value, equal to
(2^<small><sup><b><tt>gx_max_color_value_bits</tt></b></sup></small>)-1.
</dl>

<dl>
<dt><b><tt>gx_device</tt></b> (defined in 
<a href="../src/gxdevice.h">gxdevice.h</a>)
<dd>This is the device structure, as explained above.
</dl>

<dl>
<dt><b><tt>gs_matrix</tt></b> (defined in 
<a href="../src/gsmatrix.h">gsmatrix.h</a>)
<dd>This is a 2-D homogeneous coordinate transformation matrix, used by
many Ghostscript operators.
</dl>

<dl>
<dt><b><tt>gx_color_index</tt></b> (defined in 
<a href="../src/gxcindex.h">gxcindex.h</a>)
<dd>This is meant to be whatever the driver uses to represent a device
color.  For example, it might be an index in a color map, or it might be R,
G, and B values packed into a single integer.  Ghostscript doesn't ever do
any computations with <b><tt>gx_color_index</tt></b> values: it gets them
from <b><tt>encode_color</tt></b> and
hands them back as arguments to several other procedures.

<p>
The special
value <b><tt>gx_no_color_index</tt></b> (defined as
<b><tt>(~(gx_color_index)(0))</tt></b>&nbsp;) means "transparent" for some of
the procedures.

<p>
The size of <b><tt>gx_color_index</tt></b> can be either 32 or 64 bits. The 
choice depends upon the architecture of the CPU and the compiler. The default 
type definition is simply: 

<blockquote><b><tt>
typedef unsigned long gx_color_index;
</tt></b></blockquote>

However if <b><tt>GX_COLOR_INDEX_TYPE</tt></b> is defined, then it is used
as the type for <b><tt>gx_color_index</tt></b>.

<blockquote><b><tt>
typedef GX_COLOR_INDEX_TYPE gx_color_index;
</tt></b></blockquote>

The smaller size (32 bits) may produce more efficient or faster executing
code. The larger size (64 bits) is needed for representing either more
bits per component or more components. An example of the later case is 
a device that supports 8 bit contone colorants using a DeviceCMYK process
color model with its four colorants and also supports additional spot
colorants.

<p>
Currently autoconf attempts to find a 64 bit type definition for the
compiler being used, and if a 64 bit type is found then
<b><tt>GX_COLOR_INDEX_TYPE</tt></b> is set to the type.

<p>
For Microsoft and the MSVC compiler, <b><tt>GX_COLOR_INDEX_TYPE</tt></b> will 
be set to <b><tt>unsigned _int64</tt></b> if <b><tt>USE_LARGE_COLOR_INDEX</tt></b> 
is set to 1 either on the make command line or by editing the definition 
 in <a href="../src/msvc32.mak">msvc32.mak</a> 
</dl>

<dl>
<dt><b><tt>gs_param_list</tt></b> (defined in <a
href="../src/gsparam.h">gsparam.h</a>) 
  <dd>This is a parameter list, which is used to read and set attributes in a
device.  See the comments in <a href="../src/gsparam.h">gsparam.h</a>, and
the <a href="#Parameters">description of the <b><tt>get_params</tt></b> and
<b><tt>put_params</tt></b> procedures</a> below, for more detail.
</dl>

<dl>
<dt><b><tt>gx_tile_bitmap</tt></b> (defined in
<a href="../src/gxbitmap.h">gxbitmap.h</a>)
<br><b><tt>gx_strip_bitmap</tt></b> (defined in
<a href="../src/gxbitmap.h">gxbitmap.h</a>)
<dd>These structure types represent bitmaps to be used as a tile for
filling a region (rectangle).  <b><tt>gx_tile_bitmap</tt></b> is an older
type lacking <b><tt>shift</tt></b> and <b><tt>rep_shift</tt></b>;
<b><tt>gx_strip_bitmap</tt></b> has superseded it, and it should not be
used in new code.  Here is a copy of the relevant part of the file:

<blockquote>
<pre>
/*
 * Structure for describing stored bitmaps.
 * Bitmaps are stored bit-big-endian (i.e., the 2^7 bit of the first
 * byte corresponds to x=0), as a sequence of bytes (i.e., you can't
 * do word-oriented operations on them if you're on a little-endian
 * platform like the Intel 80x86 or VAX).  Each scan line must start on
 * a (32-bit) word boundary, and hence is padded to a word boundary,
 * although this should rarely be of concern, since the raster and width
 * are specified individually.  The first scan line corresponds to y=0
 * in whatever coordinate system is relevant.
 *
 * For bitmaps used as halftone tiles, we may replicate the tile in
 * X and/or Y, but it is still valuable to know the true tile dimensions
 * (i.e., the dimensions prior to replication).  Requirements:
 *      width % rep_width = 0
 *      height % rep_height = 0
 *
 * For halftones at arbitrary angles, we provide for storing the halftone
 * data as a strip that must be shifted in X for different values of Y.
 * For an ordinary (non-shifted) halftone that has a repetition width of
 * W and a repetition height of H, the pixel at coordinate (X,Y)
 * corresponds to halftone pixel (X mod W, Y mod H), ignoring phase;
 * for a shifted halftone with shift S, the pixel at (X,Y) corresponds
 * to halftone pixel ((X + S * floor(Y/H)) mod W, Y mod H).  Requirements:
 *      strip_shift &lt; rep_width
 *      strip_height % rep_height = 0
 *      shift = (strip_shift * (size.y / strip_height)) % rep_width
 */
typedef struct gx_strip_bitmap_s {
        byte *data;
        int raster;                     /* bytes per scan line */
        gs_int_point size;              /* width, height */
        gx_bitmap_id id;
        ushort rep_width, rep_height;   /* true size of tile */
        ushort strip_height;
        ushort strip_shift;
        ushort shift;
} gx_strip_bitmap;</pre>
</blockquote>
</dl>

<hr>

<h2><a name="Coding_conventions"></a>Coding conventions</h2>

<p>
All the driver procedures defined below that return <b><tt>int</tt></b>
results return 0 on success, or an appropriate negative error code in the
case of error conditions.  The error codes are defined in <a
href="../src/gserrors.h">gserrors.h</a>; they correspond directly to the
errors defined in the PostScript language reference manuals.  The most
common ones for drivers are:

<blockquote><dl>
<dt><b><tt>gs_error_invalidfileaccess</tt></b> 
<dd>An attempt to open a file failed.

<dt><b><tt>gs_error_ioerror</tt></b> 
<dd>An error occurred in reading or writing a file.

<dt><b><tt>gs_error_limitcheck</tt></b> 
 <dd>An otherwise valid parameter value was too large for the
implementation.

<dt><b><tt>gs_error_rangecheck</tt></b> 
<dd>A parameter was outside the valid range.

<dt><b><tt>gs_error_VMerror</tt></b> 
<dd>An attempt to allocate memory failed.  (If this happens, the procedure
should release all memory it allocated before it returns.)
</dl></blockquote>

<p>
If a driver does return an error, rather than a simple return statement it
should use the <b><tt>return_error</tt></b> macro defined in <a
href="../src/gx.h">gx.h</a>, which is automatically included by <a
href="../src/gdevprn.h">gdevprn.h</a> but not by <a
href="../src/gserrors.h">gserrors.h</a>.  For example

<blockquote>
<b><tt> return_error(gs_error_VMerror);
</tt></b></blockquote>

<h3><a name="Allocating_storage"></a>Allocating storage</h3>

<p>
While most drivers (especially printer drivers) follow a very similar
template, there is one important coding convention that is not obvious from
reading the code for existing drivers: driver procedures must not use
<b><tt>malloc</tt></b> to allocate any storage that stays around after the
procedure returns. Instead, they must use <b><tt>gs_malloc</tt></b> and
<b><tt>gs_free</tt></b>, which have slightly different calling conventions.
(The prototypes for these are in <a href="../src/gsmemory.h">gsmemory.h</a>, 
which is included in <a href="../src/gx.h">gx.h</a>, which is included in <a
href="../src/gdevprn.h">gdevprn.h</a>.) This is necessary so that
Ghostscript can clean up all allocated memory before exiting, which is
essential in environments that provide only single-address-space
multi-tasking (some versions of Microsoft Windows). 

<blockquote>
<pre>char *gs_malloc(uint num_elements, uint element_size,
  const char *client_name);</pre>
</blockquote>

<p>
Like <b><tt>calloc</tt></b>, but unlike <b><tt>malloc</tt></b>,
<b><tt>gs_malloc</tt></b> takes an element count and an element size. For
structures, <b><tt>num_elements</tt></b> is 1 andi
<b><tt>element_size</tt></b> is <b><tt>sizeof</tt></b> the structure; for
byte arrays, <b><tt>num_elements</tt></b> is the number of bytes and
<b><tt>element_size</tt></b> is 1. Unlike <b><tt>calloc</tt></b>,
<b><tt>gs_malloc</tt></b> does <b>not</b> clear the block of storage. 

<p>
The <b><tt>client_name</tt></b> is used for tracing and debugging.  It must
be a real string, not <b><tt>NULL</tt></b>.  Normally it is the name of the
procedure in which the call occurs.

<blockquote>
<pre>void gs_free(char *data, uint num_elements, uint element_size,
  const char *client_name);</pre>
</blockquote>

<p>
Unlike <b><tt>free</tt></b>, <b><tt>gs_free</tt></b> demands that
<b><tt>num_elements</tt></b> and element_size be supplied. It also
requires a client name, like <b><tt>gs_malloc</tt></b>. 

<h3><a name="Driver_instance_allocation"></a>Driver instance allocation</h3>

<p>i
All driver instances allocated by Ghostscript's standard allocator must
point to a "structure descriptor" that tells the garbage collector how to
trace pointers in the structure. For drivers registered in the normal way
(using the makefile approach described above), no special care is needed as
long as instances are created only by calling the
<b><tt>gs_copydevice</tt></b> procedure defined in <a
href="../src/gsdevice.h">gsdevice.h</a>. If you have a need to define
devices that are not registered in this way, you must fill in the stype
member in any dynamically allocated instances with a pointer to the same
structure descriptor used to allocate the instance. For more information
about structure descriptors, see <a href="../src/gsmemory.h">gsmemory.h</a>
and <a href="../src/gsstruct.h">gsstruct.h</a>. 

<hr>

<h2><a name="Printer_drivers"></a>Printer drivers</h2>

<p>
Printer drivers (which include drivers that write some kind of raster file)
are especially simple to implement.  
The printer driver must implement a <b><tt>print_page</tt></b> or
<b><tt>print_page_copies</tt></b> procedure.  There are macros in <a
href="../src/gdevprn.h">gdevprn.h</a> that generate the device structure for
such devices, of which the simplest is <b><tt>prn_device</tt></b>; for an
example, see <a href="../src/gdevbj10.c">gdevbj10.c</a>.  If you are writing
a printer driver, we suggest you start by reading <a
href="../src/gdevprn.h">gdevprn.h</a> and the <a
href="#Color_mapping">subsection on "Color mapping"</a> below; you may be
able to ignore all the rest of the driver procedures.

<p>
The <b><tt>print_page</tt></b> procedures are defined as follows:

<blockquote>
<pre>int (*print_page)(gx_device_printer *, FILE *)
int (*print_page_copies)(gx_device_printer *, FILE *, int)</pre>
</blockquote>

<p>
This procedure must read out the rendered image from the device and write
whatever is appropriate to the file.  To read back one or more scan lines
of the image, the <b><tt>print_page</tt></b> procedure must call one of the
following procedures:

<blockquote>
<pre>int gdev_prn_copy_scan_lines(gx_device_printer *pdev, int y, byte *str,
    uint size)</pre>
</blockquote>

<p>
For this procedure, <b><tt>str</tt></b> is where the data should be copied to, and <b><tt>size</tt></b> is
the size of the buffer starting at <b><tt>str</tt></b>.  This procedure returns the number
of scan lines copied, or &lt;0 for an error.  <b><tt>str</tt></b> need not be aligned.

<blockquote>
<pre>int gdev_prn_get_bits(gx_device_printer *pdev, int y, byte *str,
  byte **actual_data)</pre>
</blockquote>

<p>
This procedure reads out exactly one scan line.  If the scan line is
available in the correct format already, <b><tt>*actual_data</tt></b> is
set to point to it; otherwise, the scan line is copied to the buffer
starting at <b><tt>str</tt></b>, and <b><tt>*actual_data</tt></b> is set to
<b><tt>str</tt></b>.  This saves a copying step most of the time.
<b><tt>str</tt></b> need not be aligned; however, if
<b><tt>*actual_data</tt></b> is set to point to an existing scan line, it
will be aligned.  (See the description of the <b><tt>get_bits</tt></b>
procedure below for more details.)

<p>
In either case, each row of the image is stored in the form described in
the comment under <b><tt>gx_tile_bitmap</tt></b> above; each pixel takes
the number of bits specified as <b><tt>color_info.depth</tt></b> in the
device structure, and holds values returned by the device's
<b><tt>encode_color</tt></b> procedure.

<p>
The <b><tt>print_page</tt></b> procedure can determine the number of bytes
required to hold a scan line by calling:

<blockquote>
<pre>uint gdev_prn_raster(gx_device_printer *)</pre>
</blockquote>

<p>
For a very simple concrete example, we suggest reading the code in
<b><tt>bit_print_page</tt></b> in <a href="../src/gdevbit.c">gdevbit.c</a>.

<p>
If the device provides <b><tt>print_page</tt></b>, Ghostscript will call
<b><tt>print_page</tt></b> the requisite number of times to print the
desired number of copies; if the device provides
<b><tt>print_page_copies</tt></b>, Ghostscript will call
<b><tt>print_page_copies</tt></b> once per page, passing it the desired
number of copies.

<hr>

<h2><a name="Driver_procedures"></a>Driver procedures</h2>

<p>
Most of the procedures that a driver may implement are optional.  If a
device doesn't supply an optional procedure <b><tt>WXYZ</tt></b>, the entry
in the procedure structure may be either <b><tt>gx_default_WXYZ</tt></b>,
for instance <b><tt>gx_default_tile_rectangle</tt></b>, or
<b><tt>NULL</tt></b> or 0.  (The device procedure must also call the
<b><tt>gx_default_</tt></b> procedure if it doesn't implement the function
for particular values of the arguments.)  Since C compilers supply 0 as the
value for omitted structure elements, this convention means that statically
initialized procedure structures continue to work even if new (optional)
members are added.

<h3><a name="Life_cycle"></a>Life cycle</h3>

<p>
A device instance begins life in a closed state.  In this state, no output
operations will occur.  Only the following procedures may be called:

<blockquote><b><tt>
open_device<br>
finish_copydevice<br>
get_initial_matrix<br>
get_params<br>
put_params<br>
get_hardware_params
</tt></b></blockquote>

<p>
When <b><tt>setdevice</tt></b> installs a device instance in the graphics
state, it checks whether the instance is closed or open.  If the instance
is closed, <b><tt>setdevice</tt></b> calls the open routine, and then sets
the state to open.

<p>
There is no user-accessible operation to close a device instance.  This is
not an oversight -- it is required in order to enforce the following
invariant:

<blockquote>
If a device instance is the current device in <em>any</em> graphics state,
it must be open (have <b><tt>is_open</tt></b> set to true).
</blockquote>

<p>
Device instances are only closed when they are about to
be freed, which occurs in three situations:

<ul>
<li>When a <b><tt>restore</tt></b> occurs, if the instance was created since
the corresponding <b><tt>save</tt></b> and is in a VM being restored.  I.e.,
if the instance was created in local VM since a <b><tt>save</tt></b>, it
will always be closed and freed by the corresponding
<b><tt>restore</tt></b>; if it was created in global VM, it will only be
closed by the outermost <b><tt>restore</tt></b>, regardless of the save
level at the time the instance was created.

<li>By the garbage collector, if the instance is no longer accessible.

<li>When Ghostscript exits (terminates).
</ul>

<h3><a name="Open_close"></a>Open, close, sync, copy</h3>

<dl>
<dt><b><tt>int (*open_device)(gx_device *)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Open the device: do any initialization associated with making the device
instance valid. This must be done before any output to the device. The
default implementation does nothing. <b>NOTE</b>: Clients should never call
a device's <b><tt>open_device</tt></b> procedure directly: they should
always call <b><tt>gs_opendevice</tt></b> instead. 
</dl>

<dl>
<dt><b><tt>int (*finish_copydevice)(gx_device *dev, const gx_device
*from_dev)</tt></b> <b><em>[OPTIONAL]</em></b> <dd>Perform any cleanup
required after <b><tt>copydevice</tt></b> has created a new device instance
by copying <b><tt>from_dev</tt></b>. If the copy operation should not be
allowed, this procedure should return an error; the copy will be freed. The
default implementation allows copying the device prototype, but does not
allow copying device instances, because instances may contain internal
pointers that should not be shared between copies, and there is no way to
determine this from outside the device. <b>NOTE</b>: Clients should never
call a device's <b><tt>finish_copydevice</tt></b> procedure: this procedure 
is only intended for use by <b><tt>gs_copydevice[2]</tt></b>. 
</dl>

<dl>
<dt><b><tt>void (*get_initial_matrix)(gx_device *, gs_matrix *)</tt></b> <b><em>[OPTIONAL]</em></b> 
<dd>Construct the initial transformation matrix mapping user coordinates
(nominally 1/72 inch per unit) to device coordinates.  The default
procedure computes this from width, height, and
[<b><tt>xy</tt></b>]<b><tt>_pixels_per_inch</tt></b> on the assumption that
the origin is in the upper left corner, that is
<blockquote>
<b><tt>xx</tt></b> = <b><tt>x_pixels_per_inch</tt></b>/72, <b><tt>xy</tt></b> = 0,<br>
<b><tt>yx = 0, yy = -y_pixels_per_inch</tt></b>/72,<br>
<b><tt>tx = 0, ty = height</tt></b>.
</blockquote>
</dl>

<dl>
<dt><b><tt>int (*sync_output)(gx_device *)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Synchronize the device.  If any output to the device has been
buffered, send or write it now.  Note that this may be called several times
in the process of constructing a page, so printer drivers should <b>not</b>
implement this by printing the page.  The default implementation does
nothing.
</dl>

<dl>
<dt><b><tt>int (*output_page)(gx_device *, int num_copies, int flush)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Output a fully composed page to the device.  The
<b><tt>num_copies</tt></b> argument is the number of copies that should be
produced for a hardcopy device.  (This may be ignored if the driver has
some other way to specify the number of copies.)  The <b><tt>flush</tt></b>
argument is true for <b><tt>showpage</tt></b>, false for
<b><tt>copypage</tt></b>.  The default definition just calls
<b><tt>sync_output</tt></b>.  Printer drivers should implement this by
printing and ejecting the page.
</dl>

<dl>
<dt><b><tt>int (*close_device)(gx_device *)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Close the device: release any associated resources. After this, output
to the device is no longer allowed. The default implementation does
nothing.  <b>NOTE</b>: Clients should never call a device's
<b><tt>close_device</tt></b> procedure directly: they should always call
<b><tt>gs_closedevice</tt></b> instead. 
</dl>
<h3><a name="Color_mapping"></a>Color and alpha mapping</h3>

<p>
Note that code in the Ghostscript library may cache the results of calling
one or more of the color mapping procedures.  If the result returned by any
of these procedures would change (other than as a result of a change made by
the driver's <b><tt>put_params</tt></b> procedure), the driver must call
<b><tt>gx_device_decache_colors(dev)</tt></b>.

<p>
The <b><tt>map_rgb_color</tt></b>, <b><tt>map_color_rgb</tt></b>, and 
<b><tt>map_cmyk_color</tt></b> are obsolete. They have been left
in the device procedure list for backward compatibility. See the
<b><tt>encode_color</tt></b> and <b><tt>decode_color</tt></b> procedures
below. To insure that older device drivers are changed to use the new
<b><tt>encode_color</tt></b> and <b><tt>decode_color</tt></b> 
procedures,
the parameters for the older procedures have been changed to
match the new procedures.  To minimize changes in devices that have
already been written, the map_rgb_color and map_cmyk_color routines
are used as the default value for the encode_color routine.  The
map_cmyk_color routine is used if the number of components is four.
The map_rgb_color routine is used if the number of components is one
or three. This works okay for RGB and CMYK process color model devices.
However this does not work properly for gray devices. The encode_color
routine for a gray device is only passed one component. Thus the
map_rgb_color routine must be modified to only use a single input (instead
of three).  (See the encode_color and decode_color routines below.)


<p>
Colors can be specified to the Ghostscript graphics library in a variety
of forms.  For example, there are a wide variety of color spaces that can
be used such as Gray, RGB, CMYK, DeviceN, Separation, Indexed, CIEbasedABC,
etc.  The graphics library converts the various input color space
values into four base color spaces: Gray, RGB, CMYK, and DeviceN. The
DeviceN color space allows for specifying values for individual device
colorants or spot colors.

<p>
Colors are converted by the device in a two step process. The first step
is to convert a color in one of the base color spaces (Gray, RGB, CMYK,
or DeviceN) into values for each device colorant.  This transformation is
done via a set of procedures provided by the device.  These procedures are
provided by the <b><tt>get_color_mapping_procs</tt></b> device procedure.

<p>
Between the first and second steps, the graphics library applies transfer
functions to the device colorants. Where needed, the output of the results
after the transfer functions is used by the graphics library for halftoning.

<p>
In the second step, the device procedure <b><tt>encode_color</tt></b> is
used to convert the transfer function results into a
<b><tt>gx_color_index</tt></b> value.
The <b><tt>gx_color_index</tt></b> values are passed to specify colors
to various routines.
The choice of the encoding for a <b><tt>gx_color_index</tt></b> is
up to the device. Common choices are indexes into a color palette or
several integers packed together into a single value. The manner of this
encoding is usually opaque to the graphics library. The only exception to this
statement occurs when halftoning 5 or more colorants. In this case the
graphics library assumes that if a colorant values is zero then the
bits associated with the colorant in the <b><tt>gx_color_index</tt></b>
value are zero.

<dl>
<dt><b><tt>int get_color_comp_index(const gx_device&nbsp;* dev, const char * pname,
int name_size, int src_index)</tt></b> <b><em>[OPTIONAL]</em></b> 
<dd>This procedure returns the device colorant number of the given name.
The possible return values are -1, 0 to
<b><tt>GX_DEVICE_COLOR_MAX_COMPONENTS - 1</tt></b>, or
<b><tt>GX_DEVICE_COLOR_MAX_COMPONENTS</tt></b>. A value of -1 indicates that
the specified name is not a colorant for the device. A value of 0 to
<b><tt>GX_DEVICE_COLOR_MAX_COMPONENTS - 1</tt></b> indicates the colorant number
of the given name. A value of <b><tt>GX_DEVICE_COLOR_MAX_COMPONENTS</tt></b>
indicates that the given name is a valid colorant name for the device but the
colorant is not currently being used. This is used for implementing names
which are in SeparationColorNames but not in SeparationOrder.

<p>
The default procedure returns results based upon process color model
of DeviceGray, DeviceRGB, or DeviceCMYK selected by
<b><tt>color_info.num_components</tt></b>. This procedure must be
defined if another process color model is used by the device or spot colors are
supported by the device.
</dd>
</dl>

<dl>
<dt><b><tt>const gx_cm_color_map_procs&nbsp;* get_color_mapping_procs(const
gx_device&nbsp;* dev)</tt></b> <b><em>[OPTIONAL]</em></b> 
<dd>This procedure returns a list of three procedures. These procedures
are used to translate values in either Gray, RGB, or CMYK color spaces
into device colorant values. A separate procedure is not required for the
DeviceN and Separation color spaces since these already represent
device colorants.

<p>
The default procedure returns a list of procedures based upon
<b><tt>color_info.num_components</tt></b>.  These procedures are appropriate
for DeviceGray, DeviceRGB, or DeviceCMYK process color model devices. A
procedure must be defined if another process color model is used by the
device or spot colors are to be supported.
</dd>
</dl>

<dl>
<dt><b><tt>gx_color_index (*encode_color)(gx_device&nbsp;* dev,
gx_color_value&nbsp;* cv)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Map a set of device color values into a <b><tt>gx_color_index</tt></b>
value. The range of legal values of the
arguments is 0 to <b><tt>gx_max_color_value</tt></b>.  The default procedure
packs bits into a <b><tt>gx_color_index</tt></b> value based upon the
values in <b><tt>color_info.depth</tt></b> and
<b><tt>color_info.num_components</tt></b>.

<p>
Note that the <b><tt>encode_color</tt></b> procedure
must not return <b><tt>gx_no_color_index</tt></b> (all 1s).
</dl>

<dl>
<dt><b><tt>int (*decode_color)(gx_device&nbsp;*, gx_color_index&nbsp;color,
gx_color_value&nbsp;*&nbsp;CV)</tt></b> <b><em>[OPTIONAL]</em></b> 
<dd>This is the inverse of the <b><tt>encode_color</tt></b> procedure.
Map a <b><tt>gx_color_index</tt></b> value to color values.  The default
procedure unpacks bits from the <b><tt>gx_color_index</tt></b> value based upon
the values in <b><tt>color_info.depth</tt></b> and
<b><tt>color_info.num_components</tt></b>.
</dl>

<dl>
<dt><b><tt>gx_color_index (*map_rgb_alpha_color)(gx_device&nbsp;*,
gx_color_value&nbsp;red, gx_color_value&nbsp;green,
gx_color_value&nbsp;blue, gx_color_value&nbsp;alpha)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Map a RGB color and an opacity value to a device color.  The range of
legal values of the RGB and alpha arguments is 0 to
<b><tt>gx_max_color_value</tt></b>; <b><tt>alpha</tt></b> = 0 means
transparent, <b><tt>alpha</tt></b> = <b><tt>gx_max_color_value</tt></b>
means fully opaque.  The default is to use the
<b><tt>encode_color</tt></b> procedure and ignore alpha.

<p>
Note that if a driver implements <b><tt>map_rgb_alpha_color</tt></b>, it
must also implement <b><tt>encode_color</tt></b>, and must implement them
in such a way that
<b><tt>map_rgb_alpha_color(dev,&nbsp;r,&nbsp;g,&nbsp;b,&nbsp;gx_max_color_value)</tt></b> 
returns the same value as
<b><tt>encode_color(dev,&nbsp;CV)</tt></b>. 
</dl>

<dl>
<dt><b><tt>int (*map_color_rgb_alpha)(gx_device&nbsp;*,
gx_color_index&nbsp;color, gx_color_value&nbsp;rgba[4])</tt></b>
<b><em>[OPTIONAL]</em></b>
<dd>Map a device color code to RGB and alpha values.  The default
implementation calls <b><tt>map_color_rgb</tt></b> and fills in
<b><tt>gx_max_color_value</tt></b> for alpha.

<p>
Note that if a driver implements <b><tt>map_color_rgb_alpha</tt></b>, it
must also implement <b><tt>decode_color</tt></b>, and must implement them
in such a way that the first 3 values returned by
<b><tt>map_color_rgb_alpha</tt></b> are the same as the values returned by
<b><tt>decode_color</tt></b>.

<p>
Note that only RGB devices currently support variable opacity; alpha is ignored 
on other devices. The PDF 1.4 transparency features are supported on all devices. 
</dl>

<dl>
<dt><b><tt>typedef&nbsp;enum&nbsp;{&nbsp;go_text,
go_graphics&nbsp;}&nbsp;graphic_object_type;&nbsp;int
(*get_alpha_bits)(gx_device&nbsp;*dev,
graphic_object_type&nbsp;type)</tt></b> <b><em>[OPTIONAL] [OBSOLETE]</em></b>
<dd>This procedure is no longer used: it is replaced by the
color_info.anti_alias member of the driver structure.  However, it still
appears in the driver procedure vector for backward compatibility.  It
should never be called, and drivers should not implement it.
</dl>

<h3><a name="Pixel_level_drawing"></a>Pixel-level drawing</h3>

<p>
This group of drawing operations specifies data at the pixel level.  All
drawing operations use device coordinates and device color values.

<dl>
<dt><b><tt>int (*fill_rectangle)(gx_device&nbsp;*, int&nbsp;x,
int&nbsp;y, int&nbsp;width, int&nbsp;height,
gx_color_index&nbsp;color)</tt></b>
<dd>Fill a rectangle with a color.  The set of pixels filled is {(px,py) |
x &lt;= px &lt; x + width and y &lt;= py &lt; y + height}.  In other words,
the point <em>(x,y)</em> is included in the rectangle, as are
<em>(x+w-1,y)</em>, <em>(x,y+h-1)</em>, and <em>(x+w-1,y+h-1)</em>, but
<b><em>not</em></b> <em>(x+w,y)</em>, <em>(x,y+h)</em>, or
<em>(x+w,y+h)</em>.  If <b><tt>width</tt></b>&nbsp;&lt;=&nbsp;0 or
height&nbsp;&lt;=&nbsp;0, <b><tt>fill_rectangle</tt></b> should return 0
without drawing anything.

<p>
Note that <b><tt>fill_rectangle</tt></b> is the only non-optional procedure
in the driver interface.
</dl>

<h4><a name="Bitmap_imaging"></a>Bitmap imaging</h4>

<p>
Bitmap (or pixmap) images are stored in memory in a nearly standard way.
The first byte corresponds to <em>(0,0)</em> in the image coordinate
system: bits (or polybit color values) are packed into it left to right.
There may be padding at the end of each scan line: the distance from one
scan line to the next is always passed as an explicit argument.

<dl>
<dt><b><tt>int (*copy_mono)(gx_device&nbsp;*,
const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
int&nbsp;height, gx_color_index&nbsp;color0,
gx_color_index&nbsp;color1)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Copy a monochrome image (similar to the PostScript image operator).
Each scan line is raster bytes wide.  Copying begins at
(<b><tt>data_x</tt></b>,0) and transfers a rectangle of the given width and
height to the device at device coordinate <em>(x,y)</em>.  (If the transfer
should start at some non-zero y value in the data, the caller can adjust
the data address by the appropriate multiple of the raster.)  The copying
operation writes device color <b><tt>color0</tt></b> at each 0-bit, and
<b><tt>color1</tt></b> at each 1-bit: if <b><tt>color0</tt></b> or
<b><tt>color1</tt></b> is <b><tt>gx_no_color_index</tt></b>, the device
pixel is unaffected if the image bit is 0 or 1 respectively.  If
<b><tt>id</tt></b> is different from <b><tt>gx_no_bitmap_id</tt></b>, it
identifies the bitmap contents unambiguously; a call with the same
<b><tt>id</tt></b> will always have the same <b><tt>data</tt></b>,
<b><tt>raster</tt></b>, and data contents.

<p>
This operation, with
<b><tt>color0</tt></b>&nbsp;=&nbsp;<b><tt>gx_no_color_index</tt></b>, is
the workhorse for text display in Ghostscript, so implementing it
efficiently is very important.
</dl>

<dl>
<dt><b><tt>int (*tile_rectangle)(gx_device&nbsp;*,
const&nbsp;gx_tile_bitmap&nbsp;*tile, int&nbsp;x, int&nbsp;y,
int&nbsp;width, int&nbsp;height, gx_color_index&nbsp;color0,
gx_color_index&nbsp;color1, int&nbsp;phase_x, int&nbsp;phase_y)</tt></b>
<b><em>[OPTIONAL] [OBSOLETE]</em></b>
<dd>This procedure is still supported, but has been superseded by
<b><tt>strip_tile_rectangle</tt></b>.  New drivers should implement
<b><tt>strip_tile_rectangle</tt></b>; if they cannot cope with non-zero
shift values, they should test for this explicitly and call the default
implementation (<b><tt>gx_default_strip_tile_rectangle</tt></b>) if
shift&nbsp;!=&nbsp;0.  Clients should call
<b><tt>strip_tile_rectangle</tt></b>, not <b><tt>tile_rectangle</tt></b>.
</dl>

<dl>
<dt><b><tt>int (*strip_tile_rectangle)(gx_device&nbsp;*,
const&nbsp;gx_strip_bitmap&nbsp;*tile, int&nbsp;x, int&nbsp;y,
int&nbsp;width, int&nbsp;height, gx_color_index&nbsp;color0,
gx_color_index&nbsp;color1, int&nbsp;phase_x, int&nbsp;phase_y)</tt></b>
<b><em>[OPTIONAL]</em></b>
<dd>Tile a rectangle.  Tiling consists of doing multiple
<b><tt>copy_mono</tt></b> operations to fill the rectangle with copies of
the tile.  The tiles are aligned with the device coordinate system, to
avoid "seams".  Specifically, the (<b><tt>phase_x</tt></b>,
<b><tt>phase_y</tt></b>) point of the tile is aligned with the origin of
the device coordinate system.  (Note that this is backwards from the
PostScript definition of halftone phase.)  <b><tt>phase_x</tt></b> and
<b><tt>phase_y</tt></b> are guaranteed to be in the range
<em>[0..</em><b><tt>tile-&gt;width</tt></b><em>)</em> and
<em>[0..</em><b><tt>tile-&gt;height</tt></b><em>)</em> respectively.

<p>
If <b><tt>color0</tt></b> and <b><tt>color1</tt></b> are both
<b><tt>gx_no_color_index</tt></b>, then the tile is a color pixmap, not a
bitmap: see the next section.

<p>
This operation is the workhorse for halftone filling in Ghostscript, so
implementing it efficiently for solid tiles (that is, where either
<b><tt>color0</tt></b> and <b><tt>color1</tt></b> are both
<b><tt>gx_no_color_index</tt></b>, for colored halftones, or neither one is
<b><tt>gx_no_color_index</tt></b>, for monochrome halftones) is very
important.
</dl>

<h4><a name="Pixmap_imaging"></a>Pixmap imaging</h4>

<p>
Pixmaps are just like bitmaps, except that each pixel occupies more than
one bit.  All the bits for each pixel are grouped together (this is
sometimes called "chunky" or "Z" format).  For <b><tt>copy_color</tt></b>,
the number of bits per pixel is given by the
<b><tt>color_info.depth</tt></b> parameter in the device structure: the
legal values are 1, 2, 4, 8, 16, 24, 32, 40, 48, 56, or 64.  The pixel
values are device color codes (that is, whatever it is that
<b><tt>encode_color</tt></b> returns).

<dl>
<dt><b><tt>int (*copy_color)(gx_device&nbsp;*,
const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
int&nbsp;height)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Copy a color image with multiple bits per pixel.  The raster is in
bytes, but <b><tt>x</tt></b> and <b><tt>width</tt></b> are in pixels, not
bits.  If <b><tt>id</tt></b> is different from
<b><tt>gx_no_bitmap_id</tt></b>, it identifies the bitmap contents
unambiguously; a call with the same <b><tt>id</tt></b> will always have the
same <b><tt>data</tt></b>, <b><tt>raster</tt></b>, and data contents.

<p>
We do not provide a separate procedure for tiling with a pixmap; instead,
<b><tt>tile_rectangle</tt></b> can also take colored tiles.  This is
indicated by the <b><tt>color0</tt></b> and <b><tt>color1</tt></b>
arguments' both being <b><tt>gx_no_color_index</tt></b>.  In this case, as
for <b><tt>copy_color</tt></b>, the <b><tt>raster</tt></b> and
<b><tt>height</tt></b> in the "bitmap" are interpreted as for real bitmaps,
but the <b><tt>x</tt></b> and <b><tt>width</tt></b> are in pixels, not
bits.
</dl>

<h4><a name="Compositing"></a>Compositing</h4>

<p>
In addition to direct writing of opaque pixels, devices must also support
compositing.  Currently two kinds of compositing are defined
(<b><tt>RasterOp</tt></b> and alpha-based), but more may be added in the
future.

<blockquote>
<b><em>THIS AREA OF THE INTERFACE IS SOMEWHAT UNSTABLE: USE AT YOUR OWN
RISK.</em></b>
</blockquote>

<dl>
<dt><b><tt>int (*copy_alpha)(gx_device&nbsp;*dev,
const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
int&nbsp;height, gx_color_index&nbsp;color, int&nbsp;depth)</tt></b>
<b><em>[OPTIONAL]</em></b>
<dd>This procedure is somewhat misnamed: it was added to the interface
before we really understood alpha channel and compositing.

<p>
Fill a given region with a given color modified by an individual alpha
value for each pixel.  For each pixel, this is equivalent to
alpha-compositing with a source pixel whose alpha value is obtained from
the pixmap (<b><tt>data</tt></b>, <b><tt>data_x</tt></b>, and
<b><tt>raster</tt></b>) and whose color is the given color (which has
<b><em>not</em></b> been premultiplied by the alpha value), using the Sover
rule.  <b><tt>depth</tt></b>, the number of bits per alpha value, is either
2 or 4, and in any case is always a value returned by a previous call on
the <b><tt>get_alpha_bits</tt></b> procedure.  Note that if
<b><tt>get_alpha_bits</tt></b> always returns 1, this procedure will never
be called.
</dl>

<dl>
<dt><b><tt>int (*create_compositor)(dev_t&nbsp;*dev,
gx_device_t&nbsp;**pcdev, const&nbsp;gs_composite_t&nbsp;*pcte,
const&nbsp;gs_imager_state&nbsp;*pis, gs_memory_t&nbsp;*memory)</tt></b>
<b><em>[OPTIONAL]</em></b> 
<dd>Create a new device (called a "compositing device" or "compositor")
that will composite data written to it with the device's existing data,
according to the compositing function defined by <b><tt>*pcte</tt></b>.
Devices will normally implement this in one of the following standard ways:

<ul>
<li>Devices that don't do any imaging and don't forward any imaging
operations (for example, the null device, the hit detection device, and the
clipping list accumulation device) simply return themselves, which
effectively ignores the compositing function.

<li>"Leaf" devices that do imaging and have no special optimizations for
compositing (for example, some memory devices) ask the
<b><tt>gs_composite_t</tt></b> to create a default compositor. 

<li>Leaf devices that can implement some kinds of compositing operation 
efficiently (for example, monobit memory devices and RasterOp) inspect the
type and values of <b><tt>*pcte</tt></b> to determine whether it specifies 
such an operation: if so, they create a specialized compositor, and if not,
they ask the <b><tt>gs_composite_t</tt></b> to create a default compositor. 
</ul>

<p>
Other kinds of forwarding devices, which don't fall into any of these
categories, require special treatment.  In principle, what they do is ask
their target to create a compositor, and then create and return a copy of
themselves with the target's new compositor as the target of the copy.
There is a possible default implementation of this approach: if the
original device was <b>D</b> with target <b>T</b>, and <b>T</b> creates a
compositor <b>C</b>, then the default implementation creates a device
<b>F</b> that for each operation temporarily changes <b>D</b>'s target to
<b>C</b>, forwards the operation to <b>D</b>, and then changes <b>D</b>'s
target back to <b>T</b>.  However, the Ghostscript library currently only
creates a compositor with an imaging forwarding device as target in a few
specialized situations (banding, and bounding box computation), and these
are handled as special cases.

<p>
Note that the compositor may have a different color space, color
representation, or bit depth from the device to which it is compositing.
For example, alpha-compositing devices use standard-format chunky color
even if the underlying device doesn't.

<p>
Closing a compositor frees all of its storage, including the compositor
itself.  However, since the <b><tt>create_compositor</tt></b> call may
return the same device, clients must check for this case, and only call the
close procedure if a separate device was created.
</dl>

<p>
<font size="+1">
<b><em>[strip_]copy_rop WILL BE SUPERSEDED BY COMPOSITORS</em></b>
</font>

<dl>
<dt><b><tt>int (*copy_rop)(gx_device&nbsp;*dev,
const&nbsp;byte&nbsp;*sdata, int&nbsp;sourcex, uint&nbsp;sraster,
gx_bitmap_id&nbsp;id, const&nbsp;gx_color_index&nbsp;*scolors,
const&nbsp;gx_tile_bitmap&nbsp;*texture,
const&nbsp;gx_color_index&nbsp;*tcolors, int&nbsp;x, int&nbsp;y,
int&nbsp;width, int&nbsp;height, int&nbsp;phase_x, int&nbsp;phase_y,
int&nbsp;command)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>This procedure is still supported, but has been superseded by
<b><tt>strip_copy_rop</tt></b>.  New drivers should implement
<b><tt>strip_copy_rop</tt></b>; if they cannot cope with non-zero shift
values in the texture, they should test for this explicitly and call the
default implementation (<b><tt>gx_default_strip_copy_rop</tt></b>) if
shift&nbsp;!=&nbsp;0.  Clients should call <b><tt>strip_copy_rop</tt></b>,
not <b><tt>copy_rop</tt></b>.
</dl>

<dl>
<dt><b><tt>int (*strip_copy_rop)(gx_device&nbsp;*dev,
const&nbsp;byte&nbsp;*sdata, int&nbsp;sourcex, uint&nbsp;sraster,
gx_bitmap_id&nbsp;id, const&nbsp;gx_color_index&nbsp;*scolors,
const&nbsp;gx_strip_bitmap&nbsp;*texture,
const&nbsp;gx_color_index&nbsp;*tcolors, int&nbsp;x, int&nbsp;y,
int&nbsp;width, int&nbsp;height, int&nbsp;phase_x, int&nbsp;phase_y,
int&nbsp;command)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Combine an optional source image <b>S</b> (as for
<b><tt>copy_mono</tt></b> or <b><tt>copy_color</tt></b>) and an optional
texture <b>T</b> (a tile, as for <b><tt>tile_rectangle</tt></b>) with the
existing bitmap or pixmap <b>D</b> held by the driver, pixel by pixel,
using any 3-input Boolean operation as modified by "transparency" flags:
schematically, set <b>D&nbsp;=&nbsp;f(D,S,T)</b>, computing <b>f</b> in RGB
space rather than using actual device pixel values.  <b>S</b> and <b>T</b>
may each (independently) be a solid color, a bitmap with "foreground" and
"background" colors, or a pixmap.  This is a complex (and currently rather
slow) operation.  The arguments are as follows:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><b><tt>dev</tt></b>
	<td>&nbsp;
	<td>the device, as for all driver procedures
<tr valign=top>	<td><b><tt>sdata</tt></b>, <b><tt>sourcex</tt></b>, <b><tt>sraster</tt></b>, <b><tt>id</tt></b>, <b><tt>scolors</tt></b>
	<td>&nbsp;
	<td>specify <b>S</b>, <a href="#S_spec">see below</a>
<tr valign=top>	<td><b><tt>texture</tt></b>, <b><tt>tcolors</tt></b>
	<td>&nbsp;
	<td>specify <b>T</b>, <a href="#T_spec">see below</a>
<tr valign=top>	<td><b><tt>x</tt></b>, <b><tt>y</tt></b>, <b><tt>width</tt></b>, <b><tt>height</tt></b>
	<td>&nbsp;
	<td>as for the other copy and fill procedures
<tr valign=top>	<td><b><tt>phase_x</tt></b>, <b><tt>phase_y</tt></b>
	<td>&nbsp;
	<td>part of <b>T</b> specification, <a href="#T_spec">see below</a>
<tr valign=top>	<td><b><tt>command</tt></b>
	<td>&nbsp;
	<td><a href="#F_spec">see below</a>
</table></blockquote>
</dl>

<h5><a name="S_spec"></a>The source specification S</h5>

<p>
As noted above, the source <b>S</b> may be a solid color, a bitmap, or a
pixmap.  If <b>S</b> is a solid color:

<ul>
<li><b><tt>sdata</tt></b>, <b><tt>sourcex</tt></b>,
<b><tt>sraster</tt></b>, and <b><tt>id</tt></b> are irrelevant.

<li><b><tt>scolors</tt></b> points to two <b><tt>gx_color_index</tt></b>
values; <b><tt>scolors[0]</tt></b> = <b><tt>scolors[1]</tt></b> = the
color.
</ul>

<p>
If <b>S</b> is a bitmap:

<ul>
<li><b><tt>sdata</tt></b>, <b><tt>sourcex</tt></b>,
<b><tt>sraster</tt></b>, and <b><tt>id</tt></b> arguments are as for
<b><tt>copy_mono</tt></b> or <b><tt>copy_color</tt></b>
(<b><tt>data</tt></b>, <b><tt>data_x</tt></b>, <b><tt>raster</tt></b>,
<b><tt>id</tt></b>), and specify a source bitmap.

<li><b><tt>scolors</tt></b> points to two <b><tt>gx_color_index</tt></b>
values; <b><tt>scolors[0]</tt></b> is the background color (the color
corresponding to 0-bits in the bitmap), <b><tt>scolors[1]</tt></b> is the
foreground color (the color corresponding to 1-bits in the bitmap).
</ul>

<p>
If <b>S</b> is a pixmap:

<ul>
<li><b><tt>sdata</tt></b>, <b><tt>sourcex</tt></b>,
<b><tt>sraster</tt></b>, and <b><tt>id</tt></b> arguments are as for
<b><tt>copy_mono</tt></b> or <b><tt>copy_color</tt></b>
(<b><tt>data</tt></b>, <b><tt>data_x</tt></b>, <b><tt>raster</tt></b>,
<b><tt>id</tt></b>), and specify a source pixmap whose depth is the same as
the depth of the destination.

<li><b><tt>scolors</tt></b> is <b><tt>NULL</tt></b>.
</ul>

<p>
Note that if the source is a bitmap with background=0 and foreground=1, and
the destination is 1 bit deep, then the source can be treated as a pixmap
(scolors=<b><tt>NULL</tt></b>).

<h5><a name="T_spec"></a>The texture specification T</h5>

<p>
Similar to the source, the texture <b>T</b> may be a solid color, a bitmap,
or a pixmap.  If <b>T</b> is a solid color:

<ul>
<li>The texture pointer is irrelevant.

<li><b><tt>tcolors</tt></b> points to two <b><tt>gx_color_index</tt></b>
values; <b><tt>tcolors[0]</tt></b> = <b><tt>tcolors[1]</tt></b> = the
color.
</ul>

<p>
If <b>T</b> is a bitmap:

<ul>
<li>The texture argument points to a <b><tt>gx_tile_bitmap</tt></b>, as for
the <b><tt>tile_rectangle</tt></b> procedure.  Similarly,
<b><tt>phase_x</tt></b> and <b><tt>phase_y</tt></b> specify the offset of
the texture relative to the device coordinate system origin, again as for
<b><tt>tile_rectangle</tt></b>.  The tile is a bitmap (1 bit per pixel).

<li><b><tt>tcolors</tt></b> points to two <b><tt>gx_color_index</tt></b>
values; <b><tt>tcolors[0]</tt></b> is the background color (the color
corresponding to 0-bits in the bitmap), <b><tt>tcolors[1]</tt></b> is the
foreground color (the color corresponding to 1-bits in the bitmap).
</ul>

<p>
If <b>T</b> is a pixmap:

<ul>
<li>The texture argument points to a <b><tt>gx_tile_bitmap</tt></b> whose
depth is the same as the depth of the destination.

<li>tcolors is <b><tt>NULL</tt></b>.
</ul>

<p>
Again, if the texture is a bitmap with background=0 and foreground=1, and
the destination depth is 1, the texture bitmap can be treated as a pixmap
(tcolors=<b><tt>NULL</tt></b>).

<p>
Note that while a source bitmap or pixmap has the same width and height as
the destination, a texture bitmap or pixmap has its own width and height
specified in the <b><tt>gx_tile_bitmap</tt></b> structure, and is
replicated or clipped as needed.

<h5><a name="F_spec"></a>The function specification f</h5>

<p>
"Command" indicates the raster operation and transparency as follows:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=bottom>
	<th>Bits
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td>7-0
	<td>&nbsp;
	<td>raster op
<tr valign=top>	<td>8
	<td>&nbsp;
	<td>0 if source opaque, 1 if source transparent
<tr valign=top>	<td>9
	<td>&nbsp;
	<td>0 if texture opaque, 1 if texture transparent
<tr valign=top>	<td>?-10
	<td>&nbsp;
	<td>unused, must be 0
</table></blockquote>

<p>
The raster operation follows the Microsoft and H-P specification.  It is an
8-element truth table that specifies the output value for each of the
possible 2&times;2&times;2 input values as follows:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=bottom>
	<th>Bit
	<td>&nbsp;
	<th>Texture
	<td>&nbsp;
	<th>Source
	<td>&nbsp;
	<th>Destination
<tr>	<td colspan=7><hr>
<tr valign=top>	<td align=center>7
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>1
<tr valign=top>	<td align=center>6
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>0
<tr valign=top>	<td align=center>5
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>1
<tr valign=top>	<td align=center>4
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>0
<tr valign=top>	<td align=center>3
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>1
<tr valign=top>	<td align=center>2
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>1
	<td>&nbsp;
	<td align=center>0
<tr valign=top>	<td align=center>1
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>1
<tr valign=top>	<td align=center>0
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>0
	<td>&nbsp;
	<td align=center>0
</table></blockquote>

<p>
Transparency affects the output in the following way. A source or texture 
pixel is considered transparent if its value is all 1s (for instance, 1 for 
bitmaps, <tt>0xffffff</tt> for 24-bit RGB pixmaps) <b><em>and</em></b> the
corresponding transparency bit is set in the command. For each pixel, the
result of the Boolean operation is written into the destination iff neither
the source nor the texture pixel is transparent. (Note that the HP
RasterOp specification, on which this is based, specifies that if the
source and texture are both all 1s and the command specifies transparent
source and opaque texture, the result <b><em>should</em></b> be written in
the output. We think this is an error in the documentation.) 

<h5><a name="Compositing_notes"></a>Notes</h5>

<p>
<b><tt>copy_rop</tt></b> is defined to operate on pixels in RGB space,
again following the HP and Microsoft specification. For devices that
don't use RGB (or gray-scale with black = 0, white = all 1s) as their
native color representation, the implementation of <b><tt>copy_rop</tt></b>
must convert to RGB or gray space, do the operation, and convert back (or
do the equivalent of this). Here are the <b><tt>copy_rop</tt></b>
equivalents of the most important previous imaging calls. We assume the
declaration: 

<blockquote><b><tt>
static const gx_color_index white2[2] = { 1, 1 };
</tt></b></blockquote>

<p>
Note that <b><tt>rop3_S</tt></b> may be replaced by any other Boolean operation.
For monobit devices, we assume that black = 1.

<blockquote>
<pre>/* For all devices: */
(*fill_rectangle)(dev, x, y, w, h, color) ==&gt;

        { gx_color_index colors[2];
          colors[0] = colors[1] = color;
          (*dev_proc(dev, copy_rop))(dev, NULL, 0, 0, gx_no_bitmap_id, colors,
                                     NULL, colors /*irrelevant*/,
                                     x, y, w, h, 0, 0, rop3_S);
        }

/* For black-and-white devices only: */
(*copy_mono)(dev, base, sourcex, sraster, id,
             x, y, w, h, (gx_color_index)0, (gx_color_index)1) ==&gt;

        (*dev_proc(dev, copy_rop))(dev, base, sourcex, sraster, id, NULL,
                                   NULL, white2 /*irrelevant*/,
                                   x, y, w, h, 0, 0, rop3_S);

/* For color devices, where neither color0 nor color1 is gx_no_color_index: */
(*copy_mono)(dev, base, sourcex, sraster, id,
             x, y, w, h, color0, color1) ==&gt;

        { gx_color_index colors[2];
          colors[0] = color0, colors[1] = color1;
          (*dev_proc(dev, copy_rop))(dev, base, sourcex, sraster, id, colors,
                                     NULL, white2 /*irrelevant*/,
                                     x, y, w, h, 0, 0, rop3_S);
        }

/* For black-and-white devices only: */
(*copy_mono)(dev, base, sourcex, sraster, id,
             x, y, w, h, gx_no_color_index, (gx_color_index)1) ==&gt;

        (*dev_proc(dev, copy_rop))(dev, base, sourcex, sraster, id, NULL,
                                   NULL, white2 /*irrelevant*/,
                                   x, y, w, h, 0, 0,
                                   rop3_S | lop_S_transparent);

/* For all devices: */
(*copy_color)(dev, base, sourcex, sraster, id,
              x, y, w, h) ==&gt; [same as first copy_mono above]

/* For black-and-white devices only: */
(*tile_rectangle)(dev, tile, x, y, w, h,
                  (gx_color_index)0, (gx_color_index)1, px, py) ==&gt;

        (*dev_proc(dev, copy_rop))(dev, NULL, 0, 0, gx_no_bitmap_id,
                                   white2 /*irrelevant*/,
                                   tile, NULL,
                                   x, y, w, h, px, py, rop3_T)
</pre></blockquote>

<h3><a name="Polygon_level_drawing"></a>Polygon-level drawing</h3>

<p>
In addition to the pixel-level drawing operations that take integer device
coordinates and pure device colors, the driver interface includes
higher-level operations that draw polygons using fixed-point coordinates,
possibly halftoned colors, and possibly a non-default logical operation.

<p>
The <b><tt>fill_</tt></b>* drawing operations all use the center-of-pixel
rule: a pixel is colored iff its center falls within the polygonal region
being filled.  If a pixel center <em>(X+0.5,Y+0.5)</em> falls exactly on
the boundary, the pixel is filled iff the boundary is horizontal and the
filled region is above it, or the boundary is not horizontal and the filled
region is to the right of it.

<dl>
<dt><b><tt>int (*fill_trapezoid)(gx_device&nbsp;*dev, const&nbsp;
gs_fixed_edge&nbsp;*left, const&nbsp;gs_fixed_edge&nbsp;*right,
fixed&nbsp;ybot, fixed&nbsp;ytop, bool&nbsp;swap_axes, 
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
gs_logical_operation_t&nbsp;lop)</tt></b> <b><em>[OPTIONAL]</em></b> 
<dd>Fill a trapezoid. The bottom and top edges are parallel to the x
axis, and are defined by <b><tt>ybot</tt></b> and <b><tt>ytop</tt></b>,
respectively.  The left and right edges are defined by <b><tt>left</tt></b>
and <b><tt>right</tt></b>.  Both of these represent lines (<b><tt>gs_fixed_edge</tt></b>
is defined in <a href="../src/gxdevcli.h">gxdevcli.h</a> and consists
of <b><tt>gs_fixed_point</tt></b> <b><tt>start</tt></b> and <b><tt>end</tt></b> points).
The y coordinates of these lines need not have any specific relation to
<b><tt>ybot</tt></b> and <b><tt>ytop</tt></b>. The routine is defined this way so
that the filling algorithm can subdivide edges and still guarantee
that the exact same pixels will be filled. If
<b><tt>swap_axes</tt></b> is set, the meanings of X and Y are
interchanged. 
</dl>
<dt><b><tt>int (*fill_parallelogram)(gx_device&nbsp;*dev,
fixed&nbsp;px, fixed&nbsp;py, fixed&nbsp;ax, fixed&nbsp;ay, fixed&nbsp;bx,
fixed&nbsp;by, const&nbsp;gx_drawing_color&nbsp;*pdcolor,
gs_logical_operation_t&nbsp;lop)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Fill a parallelogram whose corners are <em>(px,py)</em>,
<em>(px+ax,py+ay)</em>, <em>(px+bx,py+by)</em>, and
<em>(px+ax+bx,py+ay+by)</em>.  There are no constraints on the values of
any of the parameters, so the parallelogram may have any orientation
relative to the coordinate axes.


<dl>
<dt><b><tt>int (*fill_triangle)(gx_device&nbsp;*dev, fixed&nbsp;px,
fixed&nbsp;py, fixed&nbsp;ax, fixed&nbsp;ay, fixed&nbsp;bx, fixed&nbsp;by,
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
gs_logical_operation_t&nbsp;lop)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Fill a triangle whose corners are <em>(px,py)</em>,
<em>(px+ax,py+ay)</em>, and <em>(px+bx,py+by)</em>.
</dl>

<dl>
<dt><b><tt>int (*draw_thin_line)(gx_device&nbsp;*dev,
fixed&nbsp;fx0, fixed&nbsp;fy0, fixed&nbsp;fx1, fixed&nbsp;fy1,
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
gs_logical_operation_t&nbsp;lop)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Draw a one-pixel-wide line from <em>(fx0,fy0)</em> to
<em>(fx1,fy1)</em>.
</dl>

<dl>
<dt><b><tt>int (*draw_line)(gx_device&nbsp;*dev, int&nbsp;x0, int&nbsp;y0,
int&nbsp;x1, int&nbsp;y1, gx_color_index&nbsp;color)</tt></b>
<b><em>[OPTIONAL] [OBSOLETE]</em></b>
<dd>This procedure is no longer used: it is replaced by the draw_thin_line
procedure.  However, still appears in the driver procedure vector for
backward compatibility.  It should never be called, and drivers should not
implement it.
</dl>

<h3><a name="High_level_drawing"></a>High-level drawing</h3>

<p>
In addition to the lower-level drawing operations described above, the
driver interface provides a set of high-level operations.  Normally these
will have their default implementation, which converts the high-level
operation to the low-level ones just described; however, drivers that
generate high-level output formats such as CGM, or communicate with devices
that have firmware for higher-level operations such as polygon fills, may
implement these high-level operations directly.  For more details, please
consult the source code, specifically:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<th align=left>Header
	<td>&nbsp;&nbsp;&nbsp;
	<th align=left>Defines
<tr valign=top>	<td><a href="../src/gxpaint.h">gxpaint.h</a>
	<td>&nbsp;
	<td><b><tt>gx_fill_params</tt></b>, <b><tt>gx_stroke_params</tt></b>
<tr valign=top>	<td><a href="../src/gxfixed.h">gxfixed.h</a>
	<td>&nbsp;
	<td><b><tt>fixed</tt></b>, <b><tt>gs_fixed_point</tt></b> (used by
	    <b><tt>gx_*_params</tt></b>)
<tr valign=top>	<td><a href="../src/gxistate.h">gxistate.h</a>
	<td>&nbsp;
	<td><b><tt>gs_imager_state</tt></b> (used by <b><tt>gx_*_params</tt></b>)
<tr valign=top>	<td><a href="../src/gxline.h">gxline.h</a>
	<td>&nbsp;
	<td><b><tt>gx_line_params</tt></b> (used by <b><tt>gs_imager_state</tt></b>)
<tr valign=top>	<td><a href="../src/gslparam.h">gslparam.h</a>
	<td>&nbsp;
	<td>line cap/join values (used by <b><tt>gx_line_params</tt></b>)
<tr valign=top>	<td><a href="../src/gxmatrix.h">gxmatrix.h</a>
	<td>&nbsp;
	<td><b><tt>gs_matrix_fixed</tt></b> (used by <b><tt>gs_imager_state</tt></b>)
<tr valign=top>	<td><a href="../src/gspath.h">gspath.h</a>, <a href="../src/gxpath.h">gxpath.h</a>, <a href="../src/gzpath.h">gzpath.h</a>
	<td>&nbsp;
	<td><b><tt>gx_path</tt></b>
<tr valign=top>	<td><a href="../src/gxcpath.h">gxcpath.h</a>, <a href="../src/gzcpath.h">gzcpath.h</a>
	<td>&nbsp;
	<td><b><tt>gx_clip_path</tt></b>
</table></blockquote>

<p>
For a minimal example of how to implement the high-level drawing operations,
see <a href="../src/gdevtrac.c">gdevtrac.c</a>.

<h4><a name="Paths"></a>Paths</h4>

<dl>
<dt><b><tt>int (*fill_path)(gx_device&nbsp;*dev,
const&nbsp;gs_imager_state&nbsp;*pis, gx_path&nbsp;*ppath,
const&nbsp;gx_fill_params&nbsp;*params,
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
const&nbsp;gx_clip_path&nbsp;*pcpath)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Fill the given path, clipped by the given clip path, according to the
given parameters, with the given color.  The clip path pointer may be
<b><tt>NULL</tt></b>, meaning do not clip.
</dl>

<dl>
<dt><b><tt>int (*stroke_path)(gx_device&nbsp;*dev,
const&nbsp;gs_imager_state&nbsp;*pis, gx_path&nbsp;*ppath,
const&nbsp;gx_stroke_params&nbsp;*params,
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
const&nbsp;gx_clip_path&nbsp;*pcpath)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Stroke the given path, clipped by the given clip path, according to the
given parameters, with the given color.  The clip path pointer may be
<b><tt>NULL</tt></b>, meaning not to clip.
</dl>

<dl>
<dt><b><tt>int (*fill_mask)(gx_device&nbsp;*dev,
const&nbsp;byte&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
int&nbsp;height, const&nbsp;gx_drawing_color&nbsp;*pdcolor, int&nbsp;depth,
int&nbsp;command, const&nbsp;gx_clip_path&nbsp;*pcpath)</tt></b>
<b><em>[OPTIONAL]</em></b>
<dd>Color the 1-bits in the given mask (or according to the alpha values,
if <b><tt>depth</tt></b>&nbsp;&gt;&nbsp;1), clipped by the given clip path,
with the given color and logical operation.  The clip path pointer may be
<b><tt>NULL</tt></b>, meaning do not clip.  The parameters
<b><tt>data</tt></b>, ..., <b><tt>height</tt></b> are as for
<b><tt>copy_mono</tt></b>; depth is as for <b><tt>copy_alpha</tt></b>;
command is as for <b><tt>copy_rop</tt></b>.
</dl>

<h4><a name="Images"></a>Images</h4>

<p>
Similar to the high-level interface for fill and stroke graphics, a high-level
interface exists for bitmap images.  The procedures in this part of the
interface are optional.

<p>
Bitmap images come in a variety of types, corresponding closely (but not
precisely) to the PostScript ImageTypes.  The generic or common part of all
bitmap images is defined by:

<blockquote>
<pre>typedef struct {
	const gx_image_type_t *type;
        gs_matrix ImageMatrix;
} gs_image_common_t;</pre>
</blockquote>

<p>
Bitmap images that supply data (all image types except
<b><tt>image_type_from_device</tt></b> (2)) are defined by:

<blockquote>
<pre>#define gs_image_max_components 5
typedef struct {
        &lt;&lt; gs_image_common_t &gt;&gt;
        int Width;
        int Height;
        int BitsPerComponent;
        float Decode[gs_image_max_components * 2];
        bool Interpolate;
} gs_data_image_t;</pre>
</blockquote>

<p>
Images that supply pixel (as opposed to mask) data are defined by:

<blockquote>
<pre>typedef enum {
	/* Single plane, chunky pixels. */
	gs_image_format_chunky = 0,
	/* num_components planes, chunky components. */
	gs_image_format_component_planar = 1,
	/* BitsPerComponent * num_components planes, 1 bit per plane */
	gs_image_format_bit_planar = 2
} gs_image_format_t;
typedef struct {
        &lt;&lt; gs_data_image_t &gt;&gt;
        const gs_color_space *ColorSpace;
        bool CombineWithColor;
} gs_pixel_image_t;</pre>
</blockquote>

<p>
Ordinary PostScript Level 1 or Level 2 (<b><tt>ImageType</tt></b> 1) images
are defined by:

<blockquote>
<pre>typedef enum {
	/* No alpha. */
	gs_image_alpha_none = 0,
	/* Alpha precedes color components. */
	gs_image_alpha_first,
	/* Alpha follows color components. */
	gs_image_alpha_last
} gs_image_alpha_t;
typedef struct {
        &lt;&lt; gs_pixel_image_t &gt;&gt;
        bool ImageMask;
        bool adjust;
	gs_image_alpha_t Alpha;
} gs_image1_t;
typedef gs_image1_t gs_image_t;</pre>
</blockquote>

<p>
Of course, standard PostScript images don't have an alpha component.  For
more details, consult the source code in <a
href="../src/gsiparam.h">gsiparam.h</a> and <b><tt>gsiparm*.h</tt></b>,
which define parameters for an image.

<p>
The <b><tt>begin[_typed_]image</tt></b> driver procedures create image
enumeration structures.  The common part of these structures consists of:

<blockquote>
<pre>typedef struct gx_image_enum_common_s {
        const gx_image_type_t *image_type;
	const gx_image_enum_procs_t *procs;
	gx_device *dev;
	gs_id id;
        int num_planes;
        int plane_depths[gs_image_max_planes];  /* [num_planes] */
	int plane_widths[gs_image_max_planes]	/* [num_planes] */
} gx_image_enum_common_t;</pre>
</blockquote>

<p>
where <b><tt>procs</tt></b> consists of:

<blockquote>
<pre>typedef struct gx_image_enum_procs_s {

        /*
         * Pass the next batch of data for processing.
         */
#define image_enum_proc_plane_data(proc)\
  int proc(gx_device *dev,\
    gx_image_enum_common_t *info, const gx_image_plane_t *planes,\
    int height)

        image_enum_proc_plane_data((*plane_data));

        /*
         * End processing an image, freeing the enumerator.
         */
#define image_enum_proc_end_image(proc)\
  int proc(gx_device *dev,\
    gx_image_enum_common_t *info, bool draw_last)

        image_enum_proc_end_image((*end_image));

	/*
	 * Flush any intermediate buffers to the target device.
	 * We need this for situations where two images interact
	 * (currently, only the mask and the data of ImageType 3).
	 * This procedure is optional (may be 0).
	 */
#define image_enum_proc_flush(proc)\
  int proc(gx_image_enum_common_t *info)

	image_enum_proc_flush((*flush));

} gx_image_enum_procs_t;</pre>
</blockquote>

<p> In other words, <b><tt>begin[_typed]_image</tt></b> sets up an
enumeration structure that contains the procedures that will process the
image data, together with all variables needed to maintain the state of the
process.  Since this is somewhat tricky to get right, if you plan to create
one of your own you should probably read an existing implementation of
<b><tt>begin[_typed]_image</tt></b>, such as the one in <a
href="../src/gdevbbox.c">gdevbbox.c</a> or <a
href="../src/gdevps.c">gdevps.c</a>.

<p>
The data passed at each call of <b><tt>image_plane_data</tt></b> consists of
one or more planes, as appropriate for the type of image.
<b><tt>begin[_typed]_image</tt></b> must initialize the
<b><tt>plane_depths</tt></b> array in the enumeration structure with the
depths (bits per element) of the planes.  The array of
<b><tt>gx_image_plane_t</tt></b> structures passed to each call of
<b><tt>image_plane_data</tt></b> then defines where the data are stored, as
follows:

<blockquote>
<pre>typedef struct gx_image_plane_s {
  const byte *data;
  int data_x;
  uint raster;
} gx_image_plane_t;</pre>
</blockquote>

<dl>
<dt><b><tt>int (*begin_image)(gx_device&nbsp;*dev,
const&nbsp;gs_imager_state&nbsp;*pis, const&nbsp;gs_image_t&nbsp;*pim,
gs_image_format_t&nbsp;format, gs_int_rect&nbsp;*prect,
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
const&nbsp;gx_clip_path&nbsp;*pcpath, gs_memory_t&nbsp;*memory,
gx_image_enum_common_t&nbsp;**pinfo)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Begin the transmission of an image.  Zero or more calls of
<b><tt>image_plane_data</tt></b> will follow, and then a call of
<b><tt>end_image</tt></b>.  The parameters of <b><tt>begin_image</tt></b>
are as follows:

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><b><tt>pis</tt></b>
	<td>&nbsp;&nbsp;&nbsp;
	<td>pointer to an imager state.  The only relevant elements of the
	    imager state are the CTM (coordinate transformation matrix),
	    the logical operation (<b><tt>RasterOp</tt></b> or
	    transparency), and the color rendering information.
<tr valign=top>	<td><b><tt>pim</tt></b>
	<td>&nbsp;
	<td>pointer to the <b><tt>gs_image_t</tt></b> structure that
	    defines the image parameters
<tr valign=top>	<td><b><tt>format</tt></b>
	<td>&nbsp;
	<td>defines how pixels are represented for
	    <b><tt>image_plane_data</tt></b>.  See the description of
	    <b><tt>image_plane_data</tt></b> below
<tr valign=top>	<td><b><tt>prect</tt></b>
	<td>&nbsp;
	<td>if not <b><tt>NULL</tt></b>, defines a subrectangle of the
	    image; only the data for this subrectangle will be passed to
	    <b><tt>image_plane_data</tt></b>, and only this subrectangle should
	    be drawn
<tr valign=top>	<td><b><tt>pdcolor</tt></b>
	<td>&nbsp;
	<td>defines a drawing color, only needed for masks or if
	    <b><tt>CombineWithColor</tt></b> is true
<tr valign=top>	<td><b><tt>pcpath</tt></b>
	<td>&nbsp;
	<td>if not <b><tt>NULL</tt></b>, defines an optional clipping path
<tr valign=top>	<td><b><tt>memory</tt></b>
	<td>&nbsp;
	<td>defines the allocator to be used for allocating bookkeeping
	    information
<tr valign=top>	<td><b><tt>pinfo</tt></b>
	<td>&nbsp;
	<td>the implementation should return a pointer to its state
	    structure here
</table></blockquote>

<p>
<b><tt>begin_image</tt></b> is expected to allocate a structure for its
bookkeeping needs, using the allocator defined by the memory parameter, and
return it in <b><tt>*pinfo</tt></b>.  <b><tt>begin_image</tt></b> should not assume that
the structures in <b><tt>*pim</tt></b>, <b><tt>*prect</tt></b>, or
<b><tt>*pdcolor</tt></b> will survive the call on
<b><tt>begin_image</tt></b> (except for the color space in
<b><tt>*pim-&gt;ColorSpace</tt></b>): it should copy any necessary parts of
them into its own bookkeeping structure.  It may, however, assume that
<b><tt>*pis</tt></b>, <b><tt>*pcpath</tt></b>, and of course
<b><tt>*memory</tt></b> will live at least until <b><tt>end_image</tt></b>
is called.

<p>
<b><tt>begin_image</tt></b> returns 0 normally, or 1 if the image does not
need any data.  In the latter case, <b><tt>begin_image</tt></b> does not
allocate an enumeration structure.
</dl>

<dl>
<dt><b><tt>int (*begin_typed_image)(gx_device&nbsp;*dev,
const&nbsp;gs_imager_state&nbsp;*pis, const&nbsp;gs_matrix&nbsp;*pmat,
const&nbsp;gs_image_common_t&nbsp;*pim, gs_int_rect&nbsp;*prect,
const&nbsp;gx_drawing_color&nbsp;*pdcolor,
const&nbsp;gx_clip_path&nbsp;*pcpath, gs_memory_t&nbsp;*memory,
gx_image_enum_common_t&nbsp;**pinfo)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>This has the same function as <b><tt>begin_image</tt></b>, except
<ul>
<li>The image may be of any <b><tt>ImageType</tt></b>, not only
<b><tt>image_type_simple</tt></b> (1);

<li>The image format is included in the image structure, not supplied as a
separate argument;

<li>The optional <b><tt>pmat</tt></b> argument provides a matrix that
substitutes for the one in the imager state;

<li>For mask images, if <b><tt>pmat</tt></b> is not <b><tt>NULL</tt></b>
and the color is pure, <b><tt>pis</tt></b> may be <b><tt>NULL</tt></b>.
</ul>
</dl>

<p>
The actual transmission of data uses the procedures in the enumeration
structure, not driver procedures, since the handling of the data usually
depends on the image type and parameters rather than the device.  These
procedures are specified as follows.

<dl>
<dt><b><tt>int (*image_plane_data)(gx_device&nbsp;*dev,
gx_image_enum_common_t&nbsp;*info,
const&nbsp;gx_image_plane_t&nbsp;*planes, int&nbsp;height)</tt></b>
<dd>This call provides more of the image source data: specifically,
<b><tt>height</tt></b> rows, with <b><tt>Width</tt></b> pixels supplied for
each row.

<p>
The data for each row are packed big-endian within each byte, as for
<b><tt>copy_color</tt></b>.  The <b><tt>data_x</tt></b> (starting X position
within the row) and <b><tt>raster</tt></b> (number of bytes per row) are
specified separately for each plane, and may include some padding at the
beginning or end of each row.  Note that for non-mask images, the input data
may be in any color space and may have any number of bits per component (1,
2, 4, 8, 12); currently mask images always have 1 bit per component, but in
the future, they might allow multiple bits of alpha.  Note also that each
call of <b><tt>image_plane_data</tt></b> passes complete pixels: for example, for
a chunky image with 24 bits per pixel, each call of
<b><tt>image_plane_data</tt></b> passes 3N bytes of data (specifically,
3&nbsp;&times;&nbsp;Width&nbsp;&times;&nbsp;height).

<p>
The interpretation of planes depends on the <b><tt>format</tt></b> member of
the <b><tt>gs_image[_common]_t</tt></b> structure:

<ul>
<li>If the format is <b><tt>gs_image_format_chunky</tt></b>,
<b><tt>planes[0].data</tt></b> points to data in "chunky" format, in which
the components follow each other (for instance, RGBRGBRGB....)

<li>If the format is <b><tt>gs_image_format_component_planar</tt></b>,
<b><tt>planes[0&nbsp;..&nbsp;N-1].data</tt></b> point to data for the
<b><em>N</em></b> components (for example, <b><em>N</em></b>=3 for RGB
data); each plane contains samples for a single component, for instance,
RR..., GG..., BB....  Note that the planes are divided by component, not by
bit: for example, for 24-bit RGB data, <b><em>N</em></b>=3, with 8-bit
values in each plane of data.

<li>If the format is <b><tt>gs_image_format_bit_planar</tt></b>,
<b><tt>planes[0&nbsp;..&nbsp;N*B-1].data</tt></b> point to data for the
<b><em>N</em></b> components of <b><em>B</em></b> bits each (for example,
<b><em>N</em></b>=3 and <b><em>B</em></b>=4 for RGB data with 4 bits per
component); each plane contains samples for a single bit, for instance, R0
R1 R2 R3 G0 G1 G2 G3 B0 B1 B2 B3.  Note that the most significant bit of
each plane comes first.
</ul>

<p>
If, as a result of this call, <b><tt>image_plane_data</tt></b> has been called with all
the data for the (sub-)image, it returns 1; otherwise, it returns 0 or an
error code as usual.

<p>
<b><tt>image_plane_data</tt></b>, unlike most other procedures that take bitmaps as
arguments, does not require the data to be aligned in any way.

<p>
Note that for some image types, different planes may have different
numbers of bits per pixel, as defined in the <b><tt>plane_depths</tt></b> array.
</dl>

<dl>
<dt><b><tt>int (*end_image)(gx_device&nbsp;*dev, void&nbsp;*info,
bool&nbsp;draw_last)</tt></b>
<dd>Finish processing an image, either because all data have been supplied
or because the caller has decided to abandon this image.
<b><tt>end_image</tt></b> may be called at any time after
<b><tt>begin_image</tt></b>.  It should free the info structure and any
subsidiary structures.  If <b><tt>draw_last</tt></b> is true, it should
finish drawing any buffered lines of the image.
</dl>

<h5><a name="Images_notes"></a>Notes</h5>

<p>
While there will almost never be more than one image enumeration in
progress -- that is, after a <b><tt>begin_image</tt></b>,
<b><tt>end_image</tt></b> will almost always be called before the next
<b><tt>begin_image</tt></b> -- driver code should not rely on this
property; in particular, it should store all information regarding the
image in the info structure, not in the driver structure.

<p>
Note that if <b><tt>begin_[typed_]image</tt></b> saves its parameters in
the info structure, it can decide on each call whether to use its own
algorithms or to use the default implementation.  (It may need to call
<b><tt>gx_default_begin</tt></b>/<b><tt>end_image</tt></b> partway
through.)  [A later revision of this document may include an example here.]

<h4><a name="Text"></a>Text</h4>

<p>
The third high-level interface handles text.  As for images, the interface
is based on creating an enumerator which then may execute the operation in
multiple steps.  As for the other high-level interfaces, the procedures are
optional.

<dl>
<dt><b><tt>int (*text_begin)(gx_device&nbsp;*dev,
gs_imager_state&nbsp;*pis, const&nbsp;gs_text_params_t&nbsp;*text,
gs_font&nbsp;*font, gx_path&nbsp;*path,
const&nbsp;gx_device_color&nbsp;*pdcolor,
const&nbsp;gx_clip_path&nbsp;*pcpath, gs_memory_t&nbsp;*memory,
gs_text_enum_t&nbsp;**ppte)</tt></b> <b><em>[OPTIONAL]</em></b>

<dd>
Begin processing text, by creating a state structure and storing it in
<b><tt>*ppte</tt></b>.  The parameters of <b><tt>text_begin</tt></b> are as
follows:
</dl>

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><b><tt>dev</tt></b>
	<td>&nbsp;&nbsp;&nbsp;
	<td>The usual pointer to the device.
<tr valign=top>	<td><b><tt>pis</tt></b>
	<td>&nbsp;&nbsp;&nbsp;
	<td>A pointer to an imager state.  All elements may be relevant,
	    depending on how the text is rendered.	
<tr valign=top>	<td><b><tt>text</tt></b>
	<td>&nbsp;
	<td>A pointer to the structure that defines the text operation
	    and parameters.  See <a href="../src/gstext.h">gstext.h</a> for details.
<tr valign=top>	<td><b><tt>font</tt></b>
	<td>&nbsp;
	<td>Defines the font for drawing.
<tr valign=top>	<td><b><tt>path</tt></b>
	<td>&nbsp;
	<td>Defines the path where the character outline will be appended
	    (if the text operation includes <b><tt>TEXT_DO_...PATH</tt></b>),
	    and whose current point indicates where drawing should occur
	    and will be updated by the string width (unless the text
	    operation includes <b><tt>TEXT_DO_NONE</tt></b>).
<tr valign=top>	<td><b><tt>pdcolor</tt></b>
	<td>&nbsp;
	<td>Defines the drawing color for the text.  Only relevant if
	    the text operation includes <b><tt>TEXT_DO_DRAW</tt></b>.
<tr valign=top>	<td><b><tt>pcpath</tt></b>
	<td>&nbsp;
	<td>If not <b><tt>NULL</tt></b>, defines an optional clipping path.
	    Only relevant if the text operation includes
	    <b><tt>TEXT_DO_DRAW</tt></b>.
<tr valign=top>	<td><b><tt>memory</tt></b>
	<td>&nbsp;
	<td>Defines the allocator to be used for allocating bookkeeping
	    information.
<tr valign=top>	<td><b><tt>ppte</tt></b>
	<td>&nbsp;
	<td>The implementation should return a pointer to its state
	    structure here.
</table></blockquote>

<p>
<b><tt>text_begin</tt></b> must allocate a structure for its bookkeeping
needs, using the allocator defined by the <b><tt>memory</tt></b> parameter,
and return it in <b><tt>*ppte</tt></b>.  <b><tt>text_begin</tt></b> may
assume that the structures passed as parameters will survive until text
processing is complete.

<p>
Clients should not call the driver <b><tt>text_begin</tt></b> procedure
directly.  Instead, they should call <b><tt>gx_device_text_begin</tt></b>,
which takes the same parameters and also initializes certain common elements
of the text enumeration structure, or <b><tt>gs_text_begin</tt></b>, which
takes many of the parameters from a graphics state structure.  For details,
see <a href="../src/gstext.h">gstext.h</a>.

<p>
The actual processing of text uses the procedures in the enumeration
structure, not driver procedures, since the handling of the text may depend
on the font and parameters rather than the device.  Text processing may also
require the client to take action between characters, either because the
client requested it (<b><tt>TEXT_INTERVENE</tt></b> in the operation) or
because rendering a character requires suspending text processing to call an
external package such as the PostScript interpreter.  (It is a deliberate
design decision to handle this by returning to the client, rather than
calling out of the text renderer, in order to avoid potentially unknown
stack requirements.)  Specifically, the client must call the following
procedures, which in turn call the procedures in the text enumerator.

<dl>
<dt><b><tt>int gs_text_process(gs_text_enum_t&nbsp;*pte)</tt></b>
<dd>Continue processing text.  This procedure may return 0 or a negative
error code as usual, or one of the following values (see
<a href="../src/gstext.h">gstext.h</a> for details).

<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><b><tt>TEXT_PROCESS_RENDER</tt></b>
	<td>The client must cause the current character to be rendered.
	    This currently only is used for PostScript Type 0-4 fonts
	    and their CID-keyed relatives.
<tr valign=top>	<td><b><tt>TEXT_PROCESS_INTERVENE</tt></b>
	<td>The client has asked to intervene between characters.
	    This is used for <b><tt>cshow</tt></b> and <b><tt>kshow</tt></b>.
</table></blockquote>
</dl>

<dl>
<dt><b><tt>int gs_text_release(gs_text_enum_t&nbsp;*pte,
client_name_t&nbsp;cname)</tt></b> <dd>Finish processing text and release
all associated structures.  Clients must call this procedure after
<b><tt>gs_text_process</tt></b> returns 0 or an error, and may call it at
any time.
</dl>

<p>
There are numerous other procedures that clients may call during text
processing.  See <a href="../src/gstext.h">gstext.h</a> for details.

<h5><a name="Text_notes"></a>Notes</h5>

<p>
Note that unlike many other optional procedures, the default implementation
of <b><tt>text_begin</tt></b> cannot simply return: like the default
implementation of <b><tt>begin[_typed]_image</tt></b>, it must create and
return an enumerator.  Furthermore, the implementation of the
<b><tt>process</tt></b> procedure (in the enumerator structure, called by
<b><tt>gs_text_process</tt></b>) cannot simply return without doing
anything, even if it doesn't want to draw anything on the output.  See the
comments in <a href="../src/gxtext.h">gxtext.h</a> for details.

<h3><a name="Reading_bits_back"></a>Reading bits back</h3>

<dl>
<dt><b><tt>int (*get_bits_rectangle)(gx_device&nbsp;*dev,
const&nbsp;gs_int_rect&nbsp;*prect, gs_get_bits_params_t&nbsp;*params,
gs_int_rect&nbsp;**unread)</tt></b> <b><em>[OPTIONAL]</em></b>

<dd>
Read a rectangle of bits back from the device.  The <b><tt>params</tt></b>
structure consists of:

<table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><b><tt>options</tt></b>
	<td>&nbsp;
	<td>the allowable formats for returning the data
<tr valign=top>	<td><b><tt>data[32]</tt></b>
	<td>&nbsp;
	<td>pointers to the returned data
<tr valign=top>	<td><b><tt>x_offset</tt></b>
	<td>&nbsp;
	<td>the X offset of the first returned pixel in data
<tr valign=top>	<td><b><tt>raster</tt></b>
	<td>&nbsp;
	<td>the distance between scan lines in the returned data
</table>

<p>
<b><tt>options</tt></b> is a bit mask specifying what formats the client is
willing to accept.  (If the client has more flexibility, the implementation
may be able to return the data more efficiently, by avoiding representation
conversions.)  The options are divided into groups.

<blockquote><dl>
<dt><b><em>alignment</em></b>
<dd>Specifies whether the returned data must be aligned in the normal
manner for bitmaps, or whether unaligned data are acceptable.

<dt><b><em>pointer or copy</em></b>
<dd>Specifies whether the data may be copied into storage provided by the
client and/or returned as pointers to existing storage. (Note that if
copying is not allowed, it is much more likely that the implementation will
return an error, since this requires that the client accept the data in the
implementation's internal format.)

<dt><b><em>X offset</em></b>
<dd>Specifies whether the returned data must have a specific X offset
(usually zero, but possibly other values to avoid skew at some later stage
of processing) or whether it may have any X offset (which may avoid skew in
the <b><tt>get_bits_rectangle</tt></b> operation itself).

<dt><b><em>raster</em></b>
<dd>Specifies whether the raster (distance between returned scan lines)
must have its standard value, must have some other specific value, or may
have any value.  The standard value for the raster is the device width
padded out to the alignment modulus when using pointers, or the minimum
raster to accommodate the X offset + width when copying (padded out to the
alignment modulus if standard alignment is required).

<dt><b><em>format</em></b>
<dd>Specifies whether the data are returned in chunky (all components of a
single pixel together), component-planar (each component has its own scan
lines), or bit-planar (each bit has its own scan lines) format.

<dt><b><em>color space</em></b>
<dd>Specifies whether the data are returned as native device pixels, or in
a standard color space.  Currently the only supported standard space is
RGB.

<dt><b><em>standard component depth</em></b>
<dd>Specifies the number of bits per component if the data are returned in
the standard color space.  (Native device pixels use
<b><tt>dev</tt></b>-&gt;<b><tt>color_info.depth</tt></b> bits per pixel.)

<dt><b><em>alpha</em></b>
<dd>Specifies whether alpha channel information should be returned as the
first component, the last component, or not at all.  Note that for devices
that have no alpha capability, the returned alpha values will be all 1s.
</dl></blockquote>

<p>
The client may set more than one option in each of the above groups; the
implementation will choose one of the selected options in each group to
determine the actual form of the returned data, and will update
<b><tt>params[].options</tt></b> to indicate the form.  The returned
<b><tt>params[].options</tt></b> will normally have only one option set per
group.

<p>
For further details on <b><tt>params</tt></b>, see <a
href="../src/gxgetbit.h">gxgetbit.h</a>.  For further details on
<b><tt>options</tt></b>, see <a href="../src/gxbitfmt.h">gxbitfmt.h</a>.

<p>
Define w = <b><tt>prect</tt></b>-&gt;q.x - <b><tt>prect</tt></b>-&gt;p.x, h
= <b><tt>prect</tt></b>-&gt;q.y - <b><tt>prect</tt></b>-&gt;p.y.  If the
bits cannot be read back (for example, from a printer), return
<b><tt>gs_error_unknownerror</tt></b>; if raster bytes is not enough space
to hold <b><tt>offset_x</tt></b> + w pixels, or if the source rectangle
goes outside the device dimensions (p.x &lt; 0 || p.y &lt; 0 || q.x &gt;
<b><tt>dev</tt></b>-&gt;width || q.y &gt; <b><tt>dev</tt></b>-&gt;height),
return <b><tt>gs_error_rangecheck</tt></b>; if any regions could not be
read, return <b><tt>gs_error_ioerror</tt></b> if unpainted is
<b><tt>NULL</tt></b>, otherwise the number of rectangles (see below);
otherwise return 0.

<p>
The caller supplies a buffer of <b><tt>raster</tt></b>&nbsp;&times;&nbsp;h
bytes starting at <b><tt>data[0]</tt></b> for the returned data in chunky
format, or <b><em>N</em></b> buffers of
<b><tt>raster</tt></b>&nbsp;&times;&nbsp;h bytes starting at
<b><tt>data[0]</tt></b> through
<b><tt>data[</tt></b><b><em>N-1</em></b><b><tt>]</tt></b> in planar format
where <b><em>N</em></b> is the number of components or bits.  The contents
of the bits beyond the last valid bit in each scan line (as defined by w)
are unpredictable.  data need not be aligned in any way.  If
<b><tt>x_offset</tt></b> is non-zero, the bits before the first valid bit
in each scan line are undefined.  If the implementation returns pointers to
the data, it stores them into <b><tt>data[0]</tt></b> or
<b><tt>data[</tt></b><b><em>0..N-1</em></b><b><tt>]</tt></b>.

<p>
If not all the source data are available (for example, because the source
was a partially obscured window and backing store was not available or not
used), or if the rectangle does not fall completely within the device's
coordinate system, any unread bits are undefined, and the value returned
depends on whether unread is <b><tt>NULL</tt></b>.  If unread is
<b><tt>NULL</tt></b>, return <b><tt>gs_error_ioerror</tt></b>; in this case,
some bits may or may not have been read.  If unread is not
<b><tt>NULL</tt></b>, allocate (using <b><tt>dev</tt></b>-&gt;memory) and
fill in a list of rectangles that could not be read, store the pointer to
the list in <b><tt>*unread</tt></b>, and return the number of rectangles; in
this case, all bits not listed in the rectangle list have been read back
properly.  The list is not sorted in any particular order, but the
rectangles do not overlap.  Note that the rectangle list may cover a
superset of the region actually obscured: for example, a lazy implementation
could return a single rectangle that was the bounding box of the region.
</dl>

<dl>
<dt><b><tt>int (*get_bits)(gx_device&nbsp;*dev, int&nbsp;y,
byte&nbsp;*data, byte&nbsp;**actual_data)</tt></b>
<b><em>[OPTIONAL]</em></b>
<dd>Read scan line <b><tt>y</tt></b> of bits back from the device into the
area starting at data.  This call is functionally equivalent to

<blockquote>
<pre>(*get_bits_rectangle)
  (dev, {0, y, dev-&gt;width, y+1},
   {(GB_ALIGN_ANY | (GB_RETURN_COPY | GB_RETURN_POINTER) | GB_OFFSET_0 |
     GB_RASTER_STANDARD | GB_FORMAT_CHUNKY | GB_COLORS_NATIVE |
     GB_ALPHA_NONE),
    {data}})</pre></blockquote>

<p>
with the returned value of
<b><tt>params</tt></b>-&gt;<b><tt>data[0]</tt></b> stored in
<b><tt>*actual_data</tt></b>, and will in fact be implemented this way if
the device defines a <b><tt>get_bits_rectangle</tt></b> procedure and does
not define one for <b><tt>get_bits</tt></b>.  (If
<b><tt>actual_data</tt></b> is <b><tt>NULL</tt></b>,
<b><tt>GB_RETURN_POINTER</tt></b> is omitted from the options.)
</dl>

<h3><a name="Parameters"></a>Parameters</h3>

<p>
Devices may have an open-ended set of parameters, which are simply pairs
consisting of a name and a value.  The value may be of various types:
integer (int or long), boolean, float, string, name, <b><tt>NULL</tt></b>,
array of integer, array of float, or arrays or dictionaries of mixed types.
For example, the <b><tt>Name</tt></b> of a device is a string; the
<b><tt>Margins</tt></b> of a device is an array of two floats.  See
<a href="../src/gsparam.h">gsparam.h</a> for more details.

<p>
If a device has parameters other than the ones applicable to all devices
(or, in the case of printer devices, all printer devices), it must provide
<b><tt>get_params</tt></b> and <b><tt>put_params</tt></b> procedures.  If
your device has parameters beyond those of a straightforward display or
printer, we strongly advise using the <b><tt>_get_params</tt></b> and
<b><tt>_put_params</tt></b> procedures in an existing device (for example,
<a href="../src/gdevcdj.c">gdevcdj.c</a> or <a
href="../src/gdevbit.c">gdevbit.c</a>) as a model for your own code.

<dl>
<dt><b><tt>int (*get_params)(gx_device&nbsp;*dev,
gs_param_list&nbsp;*plist)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Read the parameters of the device into the parameter list at
<b><tt>plist</tt></b>, using the <b><tt>param_write_*</tt></b>
macros or procedures defined in <a href="../src/gsparam.h">gsparam.h</a>.
</dl>

<dl>
<dt><b><tt>int (*get_hardware_params)(gx_device&nbsp;*dev,
gs_param_list&nbsp;*plist)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Read the hardware-related parameters of the device into the parameter
list at plist.  These are any parameters whose values are under control of
external forces rather than the program -- for example, front panel
switches, paper jam or tray empty sensors, etc.  If a parameter involves
significant delay or hardware action, the driver should only determine the
value of the parameter if it is "requested" by the
<b><tt>gs_param_list</tt></b> [<b><tt>param_requested</tt></b>(plist,
<b><tt>key_name</tt></b>)].  This function may cause the asynchronous
rendering pipeline (if enabled) to be drained, so it should be used
sparingly.
</dl>

<dl>
<dt><b><tt>int (*put_params)(gx_device&nbsp;*dev,
gs_param_list&nbsp;*plist)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Set the parameters of the device from the parameter list at
<b><tt>plist</tt></b>, using the <b><tt>param_read_</tt></b>*
macros/procedures defined in <a href="../src/gsparam.h">gsparam.h</a>.  All
<b><tt>put_params</tt></b> procedures must use a "two-phase commit"
algorithm; see <a href="../src/gsparam.h">gsparam.h</a> for details.
</dl>

<h4><a name="Default_CRD_parameters"></a>Default color rendering
dictionary (CRD) parameters</h4>

<p>
Drivers that want to provide one or more default CIE color rendering
dictionaries (CRDs) can do so through <b><tt>get_params</tt></b>.  To do
this, they create the CRD in the usual way (normally using the
<b><tt>gs_cie_render1_build</tt></b> and <b><tt>_initialize</tt></b>
procedures defined in <a href="../src/gscrd.h">gscrd.h</a>), and then write
it as a parameter using <b><tt>param_write_cie_render1</tt></b> defined in
<a href="../src/gscrdp.h">gscrdp.h</a>.  However, the TransformPQR procedure
requires special handling.  If the CRD uses a TransformPQR procedure
different from the default (identity), the driver must do the following:

<ul>
<li>The TransformPQR element of the CRD must include a
<b><tt>proc_name</tt></b>, and optionally <b><tt>proc_data</tt></b>.  The
<b><tt>proc_name</tt></b> is an arbitrary name chosen by the driver to
designate the particular TransformPQR function.  It must not be the same as
any device parameter name; we strongly suggest it include the device name,
for instance, "<b><tt>bitTPQRDefault</tt></b>".

<li>For each such named TransformPQR procedure, the driver's
<b><tt>get_param</tt></b> procedure must provide a parameter of the same
name.  The parameter value must be a string whose bytes are the actual
procedure address.
</ul>

<p>
For a complete example, see the <b><tt>bit_get_params</tt></b> procedure in
<a href="../src/gdevbit.c">gdevbit.c</a>.  Note that it is essential that
the driver return the CRD or the procedure address only if specifically
requested (<b><tt>param_requested(...)</tt></b> &gt; 0); otherwise, errors
will occur.

<h3><a name="External_fonts"></a>External fonts</h3>

<p>
Drivers may include the ability to display text.  More precisely, they may
supply a set of procedures that in turn implement some font and text
handling capabilities, described in <a href="Xfonts.htm">a separate
document</a>.  The link between the two is the driver procedure that
supplies the font and text procedures:

<dl>
<dt><b><tt>xfont_procs&nbsp;*(*get_xfont_procs)(gx_device&nbsp;*dev)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Return a structure of procedures for handling external fonts and text
display.  A <b><tt>NULL</tt></b> value means that this driver doesn't
provide this capability.
</dl>

<p>
For technical reasons, a second procedure is also needed:

<dl>
<dt><b><tt>gx_device&nbsp;*(*get_xfont_device)(gx_device&nbsp;*dev)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Return the device that implements <b><tt>get_xfont_procs</tt></b> in a
non-default way for this device, if any.  Except for certain special
internal devices, this is always the device argument.
</dl>

<h3><a name="Page_devices"></a>Page devices</h3>

<dl>
<dt><b><tt>gx_device&nbsp;*(*get_page_device)(gx_device&nbsp;*dev)</tt></b>
<b><em>[OPTIONAL]</em></b>
<dd>According to the Adobe specifications, some devices are "page devices"
and some are not.  This procedure returns <b><tt>NULL</tt></b> if the
device is not a page device, or the device itself if it is a page device.
In the case of forwarding devices, <b><tt>get_page_device</tt></b> returns
the underlying page device (or <b><tt>NULL</tt></b> if the underlying
device is not a page device).
</dl>

<h3><a name="Miscellaneous"></a>Miscellaneous</h3>

<dl>
<dt><b><tt>int (*get_band)(gx_device&nbsp;*dev, int&nbsp;y,
int&nbsp;*band_start)</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>If the device is a band device, this procedure stores in
<b><tt>*band_start</tt></b> the scan line (device Y coordinate) of the band
that includes the given Y coordinate, and returns the number of scan lines
in the band.  If the device is not a band device, this procedure returns 0.
The latter is the default implementation.
</dl>

<dl>
<dt><b><tt>void (*get_clipping_box)(gx_device&nbsp;*dev,
gs_fixed_rect&nbsp;*pbox))</tt></b> <b><em>[OPTIONAL]</em></b>
<dd>Stores in <b><tt>*pbox</tt></b> a rectangle that defines the device's
clipping region.  For all but a few specialized devices, this is
<em>((0,0),(width,height))</em>.
</dl>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996, 2000 Aladdin Enterprises.
All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</small></body>
</html>
leStreamDecode filter for the data
% We also add a FID entry, and possibly a Subrs entry, to each element of
% FDArray.

dup 0 {
  9 .checkfonttype {
    /CIDInit /ProcSet findresource                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Fonts and font facilities supplied with Ghostscript</title>
<!-- $Id: Fonts.htm,v 1.39 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: fonts.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>Fonts and font facilities supplied with Ghostscript</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#About">About Ghostscript fonts</a>
<li><a href="#Free_fonts">Ghostscript's free fonts</a>
<li><a href="#Other_fonts">Other free fonts</a>
<ul>
<li><a href="#Computer_Modern">Computer Modern Fontmap</a>
<li><a href="#Chinese">Free Chinese (Hanzi) fonts</a>
<li><a href="#Japanese">Free Japanese (Kanji) fonts</a>
<li><a href="#Unicode_CMaps">Unicode CMaps</a>
<li><a href="#Cyrillic">Free Cyrillic fonts</a>
<li><a href="#Partial_Unicode_fonts">(Partial) Unicode fonts</a>
</ul>
<li><a href="#Get_fonts">How Ghostscript gets fonts when it runs</a>
<li><a href="#Platform_fonts">Platform fonts</a>
<li><a href="#Add_fonts">Adding your own fonts</a>
<ul>
<li><a href="#Convert_BDF">Converting BDF fonts</a>
</ul>
<li><a href="#For_developers">For developers only</a>
<ul>
<li><a href="#Font_contents">Contents of fonts</a>
<li><a href="#Precompiling">Precompiling fonts</a>
<li><a href="#Short_identifiers">Precompiling fonts on platforms with identifier length limits</a>
<li><a href="#Unique_IDs">Font names and unique IDs</a>
<li><a href="#Codes">Codes used to make font file names</a>
</ul>
<li><a href="#Use_gs_fonts_with_X">Using Ghostscript fonts on X Windows displays</a>
<ul>
<li><a href="#Using_xset">Using <b><tt>xset</tt></b></a>
<li><a href="#Font_permanent_installation">Permanent installation</a>
<ul>
<li><a href="#Configure_xfs">Configuring the <b><tt>xfs</tt></b> font server</a>
<li><a href="#Configure_Xfree86">Xfree86 display servers</a>
</ul>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="About"></a>About Ghostscript fonts</h2>

<p>
Ghostscript is distributed with two kinds of files related to fonts:

<ul>
<li>the fonts themselves in individual files, and
<li>a file "<tt><b>Fontmap</b></tt>" that defines for
Ghostscript which file represents which font.
</ul>

<p>
Most of the font files supplied with Ghostscript have the extension
<tt><b>.pfb</b></tt>, and a few have <tt><b>.pfa</b></tt> or
<tt><b>.gsf</b></tt>.  Each file defines one ordinary PostScript Type 1
outline font which any PostScript language interpreter can use.  Files with
<tt><b>.pfa</b></tt> or <tt><b>.pfb</b></tt> extensions are also compatible
with Adobe Type Manager (ATM) and with tools that don't include a full
PostScript language interpreter; files with <tt><b>.gsf</b></tt> extension
are incompatible with ATM and other tools. Ghostscript compiled with the
"ttfont" option can also use TrueType fonts with the extension
<tt><b>.ttf</b></tt>.

<p><a name="Fontmap"></a>
When Ghostscript needs a font, it must have some way to know where to look
for it: that's the purpose of the <b><tt>Fontmap</tt></b> file, which
associates the names of <em>fonts</em> such as <b><tt>/Times-Roman</tt></b>
with the names of font <em>files</em>, such as
<tt><b>n021003l.pfb</b></tt>.  <b><tt>Fontmap</tt></b> can also create
aliases for font names, so that for instance,
<b><tt>/NimbusNo9L-Regu</tt></b> means the same font as
<b><tt>/Times-Roman</tt></b>.

<hr>

<h2><a name="Free_fonts"></a>Ghostscript's free fonts</h2>

<p>
Two sets of free fonts are supplied for Ghostscript:

<ul>
<li>35 commercial-quality Type 1 basic PostScript fonts -- Times,
Helvetica, Courier, Symbol, etc. -- contributed by URW++ Design and
Development Incorporated, of Hamburg, Germany
(<a href="http://www.urwpp.de/">http://www.urwpp.de/</a>).  Fontmap names
them all.

<li>A miscellaneous set including Cyrillic, kana, and fonts derived from
the free Hershey fonts, with improvements (such as adding accented
characters) by Thomas Wolff.  The Hershey-based fonts are quite different
from traditional printer or display fonts; you can read about them in more
detail in the <a href="Hershey.htm">documentation on Hershey fonts</a>.

</ul>

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Font packages</font><hr>
<tr>	<td><b>System</b>
	<td>&nbsp;&nbsp;
	<td><b>File name</b>
	<td>&nbsp;&nbsp;
	<td><b>Contents</b>
	<td>&nbsp;&nbsp;
	<td><b>Types</b>
<tr>	<td colspan=7><hr>
<tr valign=top>	<td>DOS and<br>MS Windows
	<td>&nbsp;
	<td><b><tt>gs###fn1.zip</tt></b>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><b><tt>.pfb</tt></b>
<tr valign=top>	<td>&nbsp;
	<td>&nbsp;
	<td><b><tt>gs###fn2.zip</tt></b>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td>Various, for<br>different fonts
<tr>	<td colspan=7><hr>
<tr valign=top>	<td>Unix
	<td>&nbsp;
	<td><b><tt>ghostscript-fonts-std-#.##.tar.gz</tt></b>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><b><tt>.afm</tt></b>,
	    <b><tt>.pfb</tt></b>,<br><b><tt>.pfm</tt></b> <tr valign=top> <td>&nbsp;
	<td>&nbsp;
	<td><b><tt>ghostscript-fonts-other-#.##.tar.gz</tt></b>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td><b><tt>.afm</tt></b>,
	    <b><tt>.gsf</tt></b>,<br><b><tt>.pfa</tt></b>, <b><tt>.pfm</tt></b>

</table>
</blockquote>

<p>
"#.##" and "###" are the version number with and without punctuation.
Fonts can be found at

<blockquote>
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs###/ (for a particular version)<br>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/" 
class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/</a> (for
several versions)
</blockquote>

<hr>

<h2><a name="Other_fonts"></a>Other free fonts</h2>

<h3><a name="Computer_Modern"></a>Computer Modern Fontmap</h3>

<p>
Don Knuth's Computer Modern fonts are popular, free, and widely available.
A Fontmap appropriate for these fonts is available from:

<blockquote>
<a
href="ftp://tug.ctan.org/tex-archive/fonts/cm/ps-type1/contrib/Fontmap.cmr" 
class="offsite">
ftp://tug.ctan.org/tex-archive/fonts/cm/ps-type1/contrib/Fontmap.cmr</a>
</blockquote>

<p>
or from other <a href="New-user.htm#CTAN">CTAN</a> sites.

<h3><a name="Chinese"></a>Free Chinese (Hanzi) fonts</h3>

<p>
A free Chinese font, originally provided by courtesy of Jackson Technology,
Ltd., Taiwan under the GPL and now distributed by the Taiwan NeXT User
Group, is available from:

<blockquote>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/hanzi/" 
class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/hanzi/</a>
</blockquote>

<p>
Prof. Wu of the Department of Economics of National Taiwan University has
created several free Type 1 Chinese fonts designed to be used with TeX.  His
e-mail is <a
href="mailto:ntut019@ccms.ntu.edu.tw">ntut019@ccms.ntu.edu.tw</a>.  The
fonts are available from

<blockquote>
<a href="ftp://cle.linux.org.tw/pub/fonts/cwfont/" 
class="offsite">ftp://cle.linux.org.tw/pub/fonts/cwfont/</a><br>
</blockquote>

<p>
Arphic Technology Co., Ltd., has made several free TrueType Chinese fonts
available under the Arphic Public License, a license very similar to the
GPL.  (Ghostscript can use TrueType fonts if Ghostscript is compiled with
the <tt><b>ttfont</b></tt> feature included: see <a
href="Make.htm#Features_and_devices">here</a> for more information.)  The
fonts and license are available from

<blockquote>
<a href="ftp://cle.linux.org.tw/pub/fonts/arphic/" 
class="offsite">ftp://cle.linux.org.tw/pub/fonts/arphic/</a><br>
</blockquote>

<h3><a name="Japanese"></a>Free Japanese (Kanji) fonts</h3>

<p>
Mr. Tetsurou Tanaka of the Department of Engineering, University of Tokyo,
has created a set of free Kanji fonts available from

<blockquote>
<a href="ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/" 
class="offsite">ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/</a><br>
</blockquote>

<p>
along with documentation in Japanese and English describing their
conditions of use and how to use them.  An older copy of these fonts, under
somewhat different names, is available at the Ghostscript site:

<blockquote>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/kanji/">
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/kanji/</a><br>
</blockquote>

<p>
Mr. Norio Katayama has done some work to make Ghostscript work well with
Kanji fonts.  An easy-to-install Kanji font for Ghostscript, with
installation instructions, is at

<blockquote>
<a href="http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html" 
class="offsite">http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html</a>
</blockquote>

<p>
The same site has patches to make Ghostscript work with Japanese VF fonts,
with documentation in both English and Japanese:

<blockquote>
<a href="http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html" 
class="offsite">http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html</a>
</blockquote>

<p>
Here are some other resources in Japanese relating to VFlib and using
Ghostscript with Japanese fonts:

<blockquote><dl compact>
<dt><a href="http://kakugawa.aial.hiroshima-u.ac.jp/~kakugawa/Hacks/" 
class="offsite">http://kakugawa.aial.hiroshima-u.ac.jp/~kakugawa/Hacks/</a>
<dt><a href="http://itohws03.ee.noda.sut.ac.jp/~matsuda/VFlib-FT/" 
class="offsite">http://itohws03.ee.noda.sut.ac.jp/~matsuda/VFlib-FT/</a>
<dd>Author &lt;<a href="mailto:matsuda@itohws01.ee.noda.sut.ac.jp">matsuda@itohws01.ee.noda.sut.ac.jp</a>&gt;
<dt><a href="http://www.rd.nacsis.ac.jp/~katayama/homepage/ghostscript/Japanese.html"
class="offsite">http://www.rd.nacsis.ac.jp/~katayama/homepage/ghostscript/Japanese.html</a>
<dd>Author &lt;<a href="mailto:katayama@rd.nacsis.ac.jp">katayama@rd.nacsis.ac.jp</a>&gt;
</dl></blockquote>

<h3><a name="Unicode_CMaps"></a>Unicode CMaps</h3>

<p>
Some Unicode CMaps that can be used with Ghostscript are freely downloadable from

<blockquote>
<a href="ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/" 
class="offsite">ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/</a>
</blockquote>

<h3><a name="Cyrillic"></a>Free Cyrillic fonts</h3>

<p>
N. Glonty and A. Samarin created in 1989 a Cyrillic extension of TeX's
"Computer Modern" fonts, now freely available through the
<a href="New-user.htm#CTAN">Comprehensive TeX Archive Network</a> (CTAN),
for instance at

<blockquote>
<a href="ftp://ctan.tug.org/tex-archive/fonts/cyrillic/cmcyr/" 
class="offsite">ftp://ctan.tug.org/tex-archive/fonts/cyrillic/cmcyr/</a>
</blockquote>

<p>
<a href="New-user.htm#CTAN">CTAN's</a> entire collection of Cyrillic fonts
is, for instance, at

<blockquote>
<a href="ftp://ctan.tug.org/tex-archive/fonts/cyrillic/" 
class="offsite">ftp://ctan.tug.org/tex-archive/fonts/cyrillic/</a>
</blockquote>

<p>
Basil K. Malyshev created the "Paradissa Fonts Collection" in 1993.  It
contained 165 fonts, including the Glonty and Samarin font above plus other
Computer Modern, Euler, and LaTeX fonts, all in PostScript Type 1 format
with <code>.afm</code> and <code>.pfm</code> files, compatible with ATM.
The collection could once be found through CTAN, for instance at

<blockquote>
http://www.ctan.org/tex-archive/fonts/
<!-- orginal was ftp://ctan.tug.org/tex-archive/fonts/postscript/cm/ -->
</blockquote>

<p>
but the collection no longer seems to be available. However, the
<a href="http://www.ctan.org/tex-archive/fonts/" class="offsite">ctan fonts directory</a>
remains an excellent source of free fonts, many of which are offered in
postscript as well we as TeX Metafont format.

<hr>

<h3><a name="Partial_Unicode_fonts"></a>(Partial) Unicode fonts</h3>

<p>
George W. Wilson is distributing some free partial Unicode fonts he created.
These fonts currently lack Arabic and CJK characters, but they include a
very large subset of the remaining Unicode set.  They are available in both
Type 1 and TrueType formats.  See

<blockquote>
<a href="http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html" 
class="offsite">http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html</a>
</blockquote>

<h2><a name="Get_fonts"></a>How Ghostscript gets fonts when it runs</h2>

<p>
Fonts occupy about 50KB each, so Ghostscript doesn't load them all
automatically when it runs.  Instead, as part of normal initialization
Ghostscript runs a file <tt><b>gs_fonts.ps</b></tt>, which arranges to load
fonts on demand using information from the font map.  To preload all of the
known fonts, invoke the procedure

<blockquote><tt><b>
loadallfonts
</b></tt></blockquote>

<p>
The file <tt><b>prfont.ps</b></tt> contains code to print a sample page of
a font.  Load this program by including it in the <tt><b>gs</b></tt>
command line or by invoking

<blockquote><tt><b>
(prfont.ps) run
</b></tt></blockquote>

<p>
Then to produce a sampler of a particular font XYZ, invoke

<blockquote><tt><b>
/XYZ DoFont
</b></tt></blockquote>

<p>For example,

<blockquote><tt><b>
/Times-Roman DoFont
</b></tt></blockquote>

<p>
For more information about how Ghostscript loads fonts during execution,
see <a href="Use.htm#Font_lookup">here</a>.

<hr>

<h2><a name="Platform_fonts"></a>Platform fonts</h2>

<p>
Ghostscript displays text on screen using whatever font technology is
provided by the system on which it runs, by calling the system's API to
display text.  On platforms with X Windows, this is X Windows; on MS
Windows it may be TrueType or ATM; Ghostscript neither knows nor cares.

<p>
The PostScript language specifies that fonts are data structures with
particular contents (for instance, they include a bounding box for the
font, an Encoding vector to specify the character set, etc.), and it is
common for PostScript files to use this fact; also, characters can be used
as clipping regions, and can be arbitrarily algorithmically rotated,
skewed, expanded or condensed, etc. Most of this information is available
in some form from the underlying graphics system, but one crucial piece is
not: the actual scalable outlines of the characters, which Ghostscript
needs in order to implement both clipping with character shapes and
arbitrarily transformed characters.  Consequently

<blockquote>
Ghostscript needs the scalable outlines of any font mentioned in a
document, and loads them from the disk (<tt><b>.pfa</b></tt>,
<tt><b>.pfb</b></tt>, or <tt><b>.gsf</b></tt>
file) in the usual way, even if it uses the platform's font machinery to
display the characters. In other words, Ghostscript must still be able to
find its font files.
</blockquote>

<p>
To make matters worse, platforms use different names for their standard
fonts.  For example, the Times Roman font, for which PostScript files use
the name "<b><tt>Times-Roman</tt></b>", may be known as
"<b><tt>Times-Roman</tt></b>", "<b><tt>Times&nbsp;Roman</tt></b>",
"<b><tt>Tms&nbsp;Rmn</tt></b>",
"<b><tt>Times&nbsp;New&nbsp;Roman</tt></b>", or
"<b><tt>TimesNewRoman</tt></b>".  The name may even be completely
different: the usual Helvetica-equivalent TrueType font is called
"<b><tt>Arial</tt></b>".  It is possible to deal with this situation by
introducing aliases in Fontmap, but there are two reasons why Ghostscript
does not currently do this:

<ol>
<li>Methods of naming in different systems are so unstandardized that there
seems to be no small set of alternative names likely to cover most
situations.  All five of the names above for Times Roman have been seen
under Windows and OS/2, depending on the version of the system, whether it
uses TrueType or ATM, and other unknown factors.

<li>Each alias takes up space at run time.  If each of the standard fonts
has three additional aliases, this might amount to 50KB of wasted space,
which may be a lot on some smaller systems.
</ol>

<p>
If you don't seem to be getting nice characters on the screen under MS
Windows, you can try adding aliases to Fontmap, according to the
documentation you'll find in there.

<hr>

<h2><a name="Add_fonts"></a>Adding your own fonts</h2>

<p>
Ghostscript can use any Type 0, 1, 3, 4, or 42 font acceptable to
other PostScript language interpreters or to ATM, including MultiMaster
fonts.  Beginning with release 4.0, Ghostscript can also use TrueType fonts
if it was compiled with the "ttfont" option.

<p>
To add fonts of your own, you must edit Fontmap to include at the end an
entry for your new font; the format for entries is documented
in Fontmap itself.  Since later entries in Fontmap override earlier
entries, a font you add at the end supersedes any corresponding fonts supplied
with Ghostscript and defined earlier in the file.

<p>
In the PC world, Type 1 fonts are customarily given names ending in
<tt><b>.PFA</b></tt> or <tt><b>.PFB</b></tt>.  Ghostscript can use these
directly: you just need to make the entry in Fontmap.  If you want to use
with Ghostscript a commercial Type 1 font (such as fonts obtained in
conjunction with Adobe Type Manager), please read carefully the license that
accompanies the font to satisfy yourself that you may do so legally; we take
no responsibility for any possible violations of such licenses.  The same
applies to TrueType fonts.

<h3><a name="Convert_BDF"></a>Converting BDF fonts</h3>

<p>
Ghostscript provides a way to construct a (low-quality) Type 1 font from a
bitmap font in the BDF format popular in the Unix world.  The shell script
<tt><b>bdftops</b></tt> (Unix) or the command file
<tt><b>bdftops.bat</b></tt> (DOS) converts a BDF file to a
scalable outline using <tt><b>bdftops.ps</b></tt> .  Run the
shell command

<blockquote><tt><b>
bdftops&nbsp;BDF_filename&nbsp;[AFM_file1_name&nbsp;...]&nbsp;gsf_filename&nbsp;fontname<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UniqueID&nbsp;[XUID]&nbsp;[encodingname]
</b></tt></blockquote>

<p>
The arguments have these meanings:
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><tt><b>BDF_filename</b></tt>
	<td>&nbsp;&nbsp;
	<td>Input bitmap file in BDF format
	<td>&nbsp;&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><tt><b>AFM_file1_name</b></tt>
	<td>&nbsp;
	<td>AFM files giving metrics
	<td>&nbsp;
	<td>(Optional)
<tr valign=top>	<td><tt><b>gsf_filename</b></tt>
	<td>&nbsp;
	<td>Output file
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><tt><b>fontname</b></tt>
	<td>&nbsp;
	<td>Name of the font
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><tt><b>UniqueID</b></tt>
	<td>&nbsp;
	<td>UniqueID (<a href="#Unique_IDs">as described below</a>)
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><tt><b>XUID</b></tt>
	<td>&nbsp;
	<td>XUID, in the form <tt><b>n1.n2.n3...</b></tt> (<a href="#Unique_IDs">as described below</a>)
	<td>&nbsp;
	<td>(Optional)
<tr valign=top>	<td><tt><b>encodingname</b></tt>
	<td>&nbsp;
	<td>"StandardEncoding" (the default), "ISOLatin1Encoding",<br>"SymbolEncoding", "DingbatsEncoding"
	<td>&nbsp;
	<td>(Optional)
</table></blockquote>

<p>
For instance

<blockquote><tt><b>
bdftops&nbsp;pzdr.bdf&nbsp;ZapfDingbats.afm&nbsp;pzdr.gsf&nbsp;ZapfDingbats&nbsp;4100000&nbsp;1000000.1.41
</b></tt></blockquote>

<p>
Then make an entry in Fontmap for the <tt><b>.gsf</b></tt>
file (<tt><b>pzdr.gsf</b></tt> in the example) as
<a href="#Add_fonts">described above</a>.

<hr>

<h2><a name="For_developers"></a>For developers only</h2>

<p>
The rest of this document is very unlikely to be of value to ordinary
users.

<h3><a name="Font_contents"></a>Contents of fonts</h3>

<p>
As noted above, Ghostscript accepts fonts in the same formats as PostScript
interpreters.  Type 0, 1, and 3 fonts are documented in the PostScript
Language Reference Manual (Second Edition); detailed documentation for Type
1 fonts appears in a separate Adobe book.  Type 2 (compressed format) fonts
are documented in separate Adobe publications.  Type 4 fonts are not
documented anywhere; they are essentially Type 1 fonts with a BuildChar or
BuildGlyph procedure.  Types 9, 10, and 11 (CIDFontType 0, 1, and 2) and
Type 32 (downloaded bitmap) fonts are documented in Adobe supplements.
Type 42 (encapsulated TrueType) fonts are documented in an Adobe
supplement; the TrueType format is documented in publications available
from Apple and Microsoft.  Ghostscript does not support Type 14 (Chameleon)
fonts, which use a proprietary Adobe format.

<h3><a name="Precompiling"></a>Precompiling fonts</h3>

<p>
You can precompile -- convert -- any Type 1 font into C, then compile and
build it into the Ghostscript executable.  (Type 1 fonts include any font
whose name ends with <tt><b>.pfa</b></tt> or
<tt><b>.pfb</b></tt>, and it also includes all the
Ghostscript <tt><b>.gsf</b></tt> fonts except the Hershey
fonts.)  This has no effect on rendering speed, but it eliminates the time
to load the font dynamically, which may make a big improvement in total
rendering time, especially for multi-page documents.  It also reduces the
number of auxiliary files required at run time.  Fonts precompiled and
built into Ghostscript this way need not appear in Fontmap, although if
they do appear there, no harm is done.

<p><a name="font2c"></a> The utility for precompiling fonts is named
<tt><b>font2c</b></tt>.  Note that since
<tt><b>font2c</b></tt> uses the PostScript language program
<tt><b>font2c.ps</b></tt>, Ghostscript must already be
available to run it, and Fontmap must contain entries for the fonts you
want to compile.  For example, to precompile the Times-Italic font,

<blockquote><tt><b>
font2c Times-Italic ptmri.c
</b></tt></blockquote>

<p>
The first argument ("<b><tt>Times-Italic</tt></b>" above) is the font's
name and the second ("<b><tt>ptmri.c</tt></b>") is the name of the
resulting C file.  You can use any file name you want, as long as it ends
in "<tt><b>.c</b></tt>".  It needn't be limited to eight characters unless
your operating system requires this.  If "<b><tt>XYZ.gsf</tt></b>" or
"<b><tt>XYZ.pfa</tt></b>" is the font file's name in Fontmap,
"<b><tt>XYZ.c</tt></b>" is a good choice for the C file.

<p>
Under VMS, or other systems whose the C compilers limit the length of
identifiers, you must do something slightly more complicated; for that see
the section on <a href="#Short_identifiers">short identifiers in C</a>.  On
VMS also, you must quote the font name ("{font name}") to preserve the
name's mixed upper and lower case.  For VMS environments in general see
<a href="Make.htm#VMS">the VMS directions</a> in the documentation on
building Ghostscript, and ignore the rest of this section.

<p>
Note that fonts are not supplied with Ghostscript in precompiled form, since
those files are quite large and can easily be recreated using <a
href="#font2c"><tt><b>font2c</b></tt></a>.  There is a makefile target to
run <tt><b>font2c</b></tt> on all the fonts supplied with Ghostscript.
Invoke it with

<blockquote><b><tt>
make fonts_standard_c
</tt></b></blockquote>

<p>Besides running <tt><b>font2c</b></tt>, you must compile the fonts and
link them into the executable.  To do this, add the compiled fonts feature
to your platform-specific makefile.  See the
<a href="Make.htm#Makefile_overview">overview of makefiles</a> in the
documentation on building Ghostscript for the list of makefiles for each
platform.  Find the definition of the <tt><b>FEATURE_DEVS</b></tt> macro in
the makefile, which looks something like this:

<blockquote><tt><b>
FEATURE_DEVS=$(PSD)psl3.dev&nbsp;$(PSD)pdf.dev&nbsp;$(PSD)dpsnext.dev&nbsp;$(PSD)pipe.dev
</b></tt></blockquote>

<p>
and add "ccfonts.dev":

<blockquote><tt><b>
FEATURE_DEVS=$(PSD)psl3.dev&nbsp;$(PSD)pdf.dev&nbsp;$(PSD)dpsnext.dev&nbsp;$(PSD)pipe.dev&nbsp;$(PSD)ccfonts.dev
</b></tt></blockquote>

<p>
Next you must add the specific fonts to <tt><b>int.mak</b></tt>, the
platform-independent makefile for the interpreter.  This makefile already
has rules for the standard fonts supplied with Ghostscript, so if you just
want to compile the standard fonts, you needn't do anything else.  Now we
describe how to compile other fonts into the executable, such as the Utopia
or Kana fonts, or your own fonts.

<p>
Suppose you want to compile the Kana fonts into the executable.  First pick
one of <b><tt>ccfonts10</tt></b> through <b><tt>ccfonts15</tt></b> as the
place you will do this, say <b><tt>ccfonts10</tt></b>.  Add your compiled
font file names, for instance

<blockquote><tt><b>
ccfonts10_=$(CFOBJ)fhirw.$(OBJ)
</b></tt></blockquote>

<p>
(Note the underscore "_".) If this makes the line too long, use another
line of the same form, for instance,

<blockquote><tt><b>
ccfonts11_=$(CFOBJ)fkarw.$(OBJ)
</b></tt></blockquote>

<p>
Just below the <b><tt>ccfonts10_=</tt></b> line is a line

<blockquote><tt><b>
ccfonts10=
</b></tt></blockquote>

<p>
(Note no underscore.) Add your own fonts to the end of this line, replacing
dashes ("-") with underscores ("_") in the font names.  For instance:

<blockquote><tt><b>
ccfonts10=Calligraphic_Hiragana
</b></tt></blockquote>

<p>
Again, if a line becomes too long, add another line of the same form, for
instance,

<blockquote><tt><b>
ccfonts10=Calligraphic_Hiragana<br>
ccfonts11=Calligraphic_Katakana
</b></tt></blockquote>

<p>
After all the lines of this form, add a pair of lines to compile each font,
separating these entries from the "ccfonts*" lines and from each other with
a blank line.  In our example this becomes

<blockquote>
<pre>$(CFOBJ)fhirw.$(OBJ): $(CFGEN)fhirw.c $(CCFONT)
	$(CFCC) $(CFO_)fhirw.$(OBJ) $(C_) $(CFGEN)fhirw.c

$(CFOBJ)fkarw.$(OBJ): $(CFGEN)fkarw.c $(CCFONT)
	$(CFCC) $(CFO_)fkarw.$(OBJ) $(C_) $(CFGEN)fkarw.c
</pre></blockquote>

<p>
Finally, run <tt><b>make</b></tt> to build an executable that includes the
fonts you added.  They are present in <b><tt>FontDirectory</tt></b> when
Ghostscript starts up.

<h3><a name="Short_identifiers"></a>Precompiling fonts on platforms with identifier length limits</h3>

<p>
On some platforms the C compiler or linker limits the number of significant
characters usable in an identifier.  On such platforms, you must do a
little extra work.

<p>
Let <em><b>N</b></em> be the maximum number of significant characters in an
identifier (typically 31).  For each font whose name is longer than
<em><b>N</b></em>-5 characters, pick an arbitrary identifier that we will
call the "short name".  This can be any string you want, as long as it
contains only letters, digits, and underscores; is no longer than
<em><b>N</b></em>-5 characters; and is different from all other font names
and short names.  A good choice for this is the name of the C file.  There
is no harm in doing this for fonts with names shorter than
<em><b>N</b></em>-5 characters, but it's unnecessary.

<p>
You must do two different things for fonts that require a short name.

<ol>
<li>You must supply the short name as a third argument to
<tt><b>font2c</b></tt>.  For example, to compile
<b><tt>NewCenturySchlbk-BoldItalic</tt></b> using the short name
<b><tt>pncbi</tt></b>,

<blockquote><tt><b>
font2c&nbsp;NewCenturySchlbk-BoldItalic&nbsp;pncbi.c&nbsp;pncbi
</b></tt></blockquote>

<li>
Then when you add the font name to the definition of one of the ccfonts*
macros in the makefile, use the short name, not the actual font name, for
instance,

<blockquote><table cellpadding=0 cellspacing=0>
<tr>	<td>Use
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<td><tt><b>ccfonts12=pncbi</b></tt>
<tr>	<td>Rather than
	<td>&nbsp;
	<td><tt><b>ccfonts12=NewCenturySchlbk_BoldItalic</b></tt>
</table></blockquote>
</ol>

<p>
Everything else is as described above.  This procedure doesn't change the
name of the font in Fontmap or as seen from within Ghostscript; it just
works around a limitation of some older compilers.

<hr>

<h3><a name="Unique_IDs"></a>Font names and unique IDs</h3>

<p>
If you create your own fonts and will use them only within your own
organization, you should use <tt><b>UniqueID</b></tt> values between
4000000 and 4999999, coded like this (see the <a href="#Codes">tables of
codes</a> for font file names below):

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Coding of UniqueID "<tt><b>4TTWVE0</b></tt>"</font><hr>
<tr>	<td><tt><b>TT</b></tt>
	<td>&nbsp;&nbsp;
	<td><a href="#Typeface">Typeface</a>
	<td>&nbsp;&nbsp;
	<td>two-digit identifier
<tr>	<td><tt><b>W</b></tt>
	<td>&nbsp;
	<td><a href="#Weight">Weight</a>
	<td>&nbsp;
	<td>normal, bold, etc.
<tr>	<td><tt><b>V</b></tt>
	<td>&nbsp;
	<td><a href="#Variant">Variant</a>
	<td>&nbsp;
	<td>normal, italic, etc.
<tr>	<td><tt><b>E</b></tt>
	<td>&nbsp;
	<td><a href="#Expansion">Expansion</a>
	<td>&nbsp;
	<td>normal, condensed, etc.
</table></blockquote>

<p>
This scheme will not work forever: as soon there are more than 99
typefaces, or more than 9 weights or variants, we will have to do something
else. But it suffices for the near future.

<p>
If you plan to distribute fonts, ask Adobe to assign you some UniqueIDs and
also an <tt><b>XUID</b></tt> for your organization. Contact

<blockquote><address>
Unique ID Coordinator<br>
Adobe Developers Association<br>
Adobe Systems, Inc.<br>
345 Park Avenue<br>
San Jose, CA  95110-2704<br>
+1-408-536-9000 telephone (ADA)<br>
+1-408-536-6883 fax<br>
<a href="mailto:fontdev-person@adobe.com">fontdev-person@adobe.com</a><br>
</address></blockquote>

<p>
The XUID is a Level 2 PostScript feature that serves the same function as
the UniqueID, but is not limited to a single 24-bit integer.  The
<tt><b>bdftops</b></tt> program creates XUIDs of the form
"<tt><b>[-X-&nbsp;0&nbsp;-U-]</b></tt>" where "<tt><b>-X-</b></tt>" is the
organization XUID and "<tt><b>-U-</b></tt>" is the UniqueID.  (Aladdin
Enterprises' organization XUID, which appears in a few places in various
font-related files distributed with Ghostscript, is 107; do not use this for
your own fonts that you distribute.)

<p>
Because Ghostscript runs on many different systems, including DOS, the
names of font files can be no longer than 8 characters.  We therefore
construct a font's filename <tt><b>FTTWVVVE.gsf</b></tt>
similarly to the construction for temporary UniqueIDs.

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Coding of font file name "<tt><b>FTTWVVVE.gsf</b></tt>"</font><hr>
<tr>	<td><tt><b>F</b></tt>
	<td>&nbsp;&nbsp;
	<td><a href="#Foundries">Foundry</a>
	<td>&nbsp;&nbsp;
	<td>&nbsp;
<tr>	<td><tt><b>TT</b></tt>
	<td>&nbsp;
	<td><a href="#Typeface">Typeface</a>
	<td>&nbsp;
	<td>two-digit identifier
<tr>	<td><tt><b>W</b></tt>
	<td>&nbsp;
	<td><a href="#Weight">Weight</a>
	<td>&nbsp;
	<td>normal, bold, etc.
<tr>	<td><tt><b>V</b></tt>
	<td>&nbsp;
	<td><a href="#Variant">Variant</a>
	<td>&nbsp;
	<td>normal, italic, etc.
<tr>	<td><tt><b>E</b></tt>
	<td>&nbsp;
	<td><a href="#Expansion">Expansion</a>
	<td>&nbsp;
	<td>normal, condensed, etc.
</table></blockquote>

<p>
Since a font can have multiple variants (for example, Lucida Regular Sans
Typewriter Italic) we allocate three letters to that; if a font has four
variants, you're on your own.  If a font does have multiple variants, it's
best to add the expansion letter "<b><tt>r</tt></b>" to make clear which
letters are variants and which the expansion.  This scheme is very close to
the one proposed in "Filenames for fonts", published in the first 1990
issue of <em>TUGboat</em> (the journal of the TeX Users Group).

<h3><a name="Codes"></a>Codes used to make font file names</h3>

<p>
In the following tables we make no attempt to be exhaustive: instead we
have simply allocated entries for those things that we needed for the fonts
that we are actually distributing.

<p>
<a name="Foundries"></a>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Font foundry codes</font><hr>
<tr>	<th>ID
	<th>&nbsp;&nbsp;
	<th align=left>Foundry
<tr>	<td colspan=3><hr>
<tr>	<td><tt><b>b</b></tt>
	<td>&nbsp;&nbsp;
	<td>Bitstream
<tr>	<td><tt><b>f</b></tt>
	<td>&nbsp;
	<td>Freely distributable and public-domain
<tr>	<td><tt><b>hr</b></tt>
	<td>&nbsp;
	<td>Hershey
<tr>	<td><tt><b>n</b></tt>
	<td>&nbsp;
	<td>IBM
<tr>	<td><tt><b>p</b></tt>
	<td>&nbsp;
	<td>Adobe ("p" for PostScript)
<tr>	<td><tt><b>u</b></tt>
	<td>&nbsp;
	<td>URW[++]
</table></blockquote>

<p>
<a name="Typeface"></a>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Typeface codes</font><hr>
<tr valign=bottom>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Name
	<td>&nbsp;&nbsp;
	<th align=left>Filename<br>prefix
	<td>&nbsp;&nbsp;
	<th align=left>Source
<tr>	<td colspan=7><hr>
<tr>	<td><tt><b>08</b></tt>
	<td>&nbsp;
	<td>Avant Garde
	<td>&nbsp;
	<td><tt><b>pag</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>11</b></tt>
	<td>&nbsp;
	<td>Bookman
	<td>&nbsp;
	<td><tt><b>pbk</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>01</b></tt>
	<td>&nbsp;
	<td>CharterBT
	<td>&nbsp;
	<td><tt><b>bch</b></tt>
	<td>&nbsp;
	<td>Bitstream
<tr>	<td><tt><b>02</b></tt>
	<td>&nbsp;
	<td>Courier
	<td>&nbsp;
	<td><tt><b>ncr</b></tt>
	<td>&nbsp;
	<td>IBM
<tr>	<td><tt><b>03</b></tt>
	<td>&nbsp;
	<td>Helvetica
	<td>&nbsp;
	<td><tt><b>phv</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>04</b></tt>
	<td>&nbsp;
	<td>New Century Schoolbook
	<td>&nbsp;
	<td><tt><b>pnc</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>09</b></tt>
	<td>&nbsp;
	<td>Palatino
	<td>&nbsp;
	<td><tt><b>ppl</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>05</b></tt>
	<td>&nbsp;
	<td>Symbol
	<td>&nbsp;
	<td><tt><b>psy</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>06</b></tt>
	<td>&nbsp;
	<td>Times
	<td>&nbsp;
	<td><tt><b>ptm</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td>--
	<td>&nbsp;
	<td>Utopia
	<td>&nbsp;
	<td><tt><b>put</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>07</b></tt>
	<td>&nbsp;
	<td>Zapf Chancery
	<td>&nbsp;
	<td><tt><b>zc</b></tt>
	<td>&nbsp;
	<td>public domain
<tr>	<td><tt><b>10</b></tt>
	<td>&nbsp;
	<td>Zapf Dingbats
	<td>&nbsp;
	<td><tt><b>pzd</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>12</b></tt>
	<td>&nbsp;
	<td>public domain Cyrillic
	<td>&nbsp;
	<td><tt><b>fcy</b></tt>
	<td>&nbsp;
	<td>public domain
<tr>	<td><tt><b>13</b></tt>
	<td>&nbsp;
	<td>Kevin Hartig Hiragana
	<td>&nbsp;
	<td><tt><b>fhi</b></tt>
	<td>&nbsp;
	<td>shareware
<tr>	<td><tt><b>14</b></tt>
	<td>&nbsp;
	<td>Kevin Hartig Katakana
	<td>&nbsp;
	<td><tt><b>fka</b></tt>
	<td>&nbsp;
	<td>shareware
<tr>	<td><tt><b>90</b></tt>
	<td>&nbsp;
	<td>Hershey Gothic English
	<td>&nbsp;
	<td><tt><b>hrge</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>91</b></tt>
	<td>&nbsp;
	<td>Hershey Gothic Italian
	<td>&nbsp;
	<td><tt><b>hrit</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>92</b></tt>
	<td>&nbsp;
	<td>Hershey Gothic German
	<td>&nbsp;
	<td><tt><b>hrgr</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>93</b></tt>
	<td>&nbsp;
	<td>Hershey Greek
	<td>&nbsp;
	<td><tt><b>hrgk</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>94</b></tt>
	<td>&nbsp;
	<td>Hershey Plain
	<td>&nbsp;
	<td><tt><b>hrpl</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>95</b></tt>
	<td>&nbsp;
	<td>Hershey Script
	<td>&nbsp;
	<td><tt><b>hrsc</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>96</b></tt>
	<td>&nbsp;
	<td>Hershey Symbol
	<td>&nbsp;
	<td><tt><b>hrsy</b></tt>
	<td>&nbsp;
	<td>freeware
</table></blockquote>

<p>
<a name="Weight"></a>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Font weight codes</font><hr>
<tr>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;
	<th align=left>Filename
<tr>	<td colspan=5><hr>
<tr>	<td><tt><b>0</b></tt>
	<td>&nbsp;&nbsp;
	<td>normal
	<td>&nbsp;&nbsp;
	<td><tt><b>r</b></tt>
<tr>	<td><tt><b>1</b></tt>
	<td>&nbsp;
	<td>bold
	<td>&nbsp;
	<td><tt><b>b</b></tt>
<tr>	<td><tt><b>2</b></tt>
	<td>&nbsp;
	<td>book
	<td>&nbsp;
	<td><tt><b>k</b></tt>
<tr>	<td><tt><b>3</b></tt>
	<td>&nbsp;
	<td>demi
	<td>&nbsp;
	<td><tt><b>d</b></tt>
<tr>	<td><tt><b>4</b></tt>
	<td>&nbsp;
	<td>light
	<td>&nbsp;
	<td><tt><b>l</b></tt>
<tr>	<td>&nbsp;
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1"><a name="Variant"></a>Font variants</font><hr>
<tr>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;
	<th align=left>Filename
<tr>	<td colspan=5><hr>
<tr>	<td><tt><b>0</b></tt>
	<td>&nbsp;&nbsp;
	<td>normal
	<td>&nbsp;&nbsp;
	<td><tt><b>r</b></tt> (omitted when weight is normal)
<tr>	<td><tt><b>1</b></tt>
	<td>&nbsp;
	<td>italic
	<td>&nbsp;
	<td><tt><b>i</b></tt>
<tr>	<td><tt><b>2</b></tt>
	<td>&nbsp;
	<td>oblique
	<td>&nbsp;
	<td><tt><b>o</b></tt>
<tr valign=top>	<td><tt><b>3</b></tt>
	<td>&nbsp;
	<td>script, handwritten, swash
	<td>&nbsp;
	<td><tt><b>w</b></tt>
<tr>	<td>&nbsp;
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1"><a name="Expansion"></a>Expansion</font><hr>
<tr>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;
	<th align=left>Filename
<tr>	<td colspan=5><hr>
<tr>	<td><tt><b>0</b></tt>
	<td>&nbsp;&nbsp;
	<td>normal
	<td>&nbsp;&nbsp;
	<td><tt><b>r</b></tt> (omitted when weight and variant are normal)
<tr>	<td><tt><b>1</b></tt>
	<td>&nbsp;
	<td>narrow
	<td>&nbsp;
	<td><tt><b>n</b></tt>
</table></blockquote>

<hr>

<h2><a name="Use_gs_fonts_with_X"></a>Using Ghostscript fonts on X Windows displays</h2>

<p>
The standard X11 distribution can display various kinds of fonts, including
the Adobe Type 1 format, so font files distributed with Ghostscript can be
used on X Windows displays.  Beginning with Ghostscript version 6.0, the
font archive contains the directory files needed to map Ghostscript's font
files to XLFDs.  Those files are named "<b><tt>fonts.dir</tt></b>" and
"<b><tt>fonts.scale</tt></b>".  There are two main methods to configure
your display to use these files.

<ul>
<li><a href="#Using_xset">With <b><tt>xset</tt></b></a> any user can add a
new directory to the font search path for the duration of a session.
<li>An administrator with root access can <a
href="#Font_permanent_installation">add the Ghostscript font directory
permanently</a> to the <a href="#X_font_catalog">X font server's
catalog</a> or to an <a href="#Xfree86_fontpath">X display server's list of
directories</a>.
</ul>

<h3><a name="Using_xset"></a>Using <b><tt>xset</tt></b></h3>

<p>
Users without root access can add the Ghostscript font directories to the
font search path using <b><tt>xset</tt></b>. Such a setting is transient
and must be repeated each time the display server is reset or restarted,
typically at login, so the call to <b><tt>xset</tt></b> should be added to
the user's "<b><tt>.xsession</tt></b>" or "<b><tt>.xinitrc</tt></b>"
startup script to make the fonts available at each login.

<p>
To add a new font directory, invoke <b><tt>xset</tt></b> like this:

<blockquote>
<b><tt>xset fp+</tt> <em>{directory}</em></b>
</blockquote>

<p>
where <b><em>{directory}</em></b> is the full pathname to the directory
containing the fonts on the host running the X display server.  For common
Ghostscript installations the path is

<blockquote>
<b><tt>/usr/local/Ghostscript/share/fonts</tt></b>
</blockquote>

<h3><a name="Font_permanent_installation"></a>Permanent installation</h3>

<p> A system administrator, or anyone with the necessary root privilege,
can make Ghostscript's fonts permanently available to the managed X display
servers.  This setup depends on the servers and the methods used
to make the fonts available.

<h4><a name="Configure_xfs"></a>Configuring the <b><tt>xfs</tt></b> font server</h4>

<p>
An X display server can obtain its font resources from a dedicated X font
server.  <b><tt>xfs</tt></b> is a prototype font server included in the X
Consortium X11 distribution.  It is configured with a file located in a
directory whose exact location is installation-dependent and could be any
of

<blockquote><b><tt>
/usr/lib/X11/fs/config
<br>/usr/X11/lib/X11/fs/config
<br>/usr/X11R6/lib/X11/fs/config
</tt></b></blockquote>

<p>
or some similar name. You can also use <b><tt>xfs</tt></b>'s
"<b><tt>-config</tt></b>" command-line option to specify the location of
the configuration file.

<p><a name="X_font_catalog"></a>
The configuration file designates a list ("catalog") of directories, each
of which contains fonts and a font mapping database (the file
"<b><tt>fonts.dir</tt></b>").  This list is specified with the
"<b><tt>catalogue=</tt></b>" keyword followed by a list of absolute
directory paths separated by commas.  To add the Ghostscript directory,
include its full name in the catalog list, for example:

<blockquote><b><tt>
catalogue&nbsp;=&nbsp;/usr/local/share/Ghostscript/fonts/,
<br>/usr/X11R6/lib/X11/fonts/misc/,
<br>/usr/X11R6/lib/X11/fonts/Speedo/,
<br>/usr/X11R6/lib/X11/fonts/Type1/,
<br>/usr/X11R6/lib/X11/fonts/75dpi/,
<br>/usr/X11R6/lib/X11/fonts/100dpi/
</tt></b></blockquote>

<p>
The fonts are searched in the order the directories are specified, so an
XLFD mapped by the Ghostscript directory could shadow a previous similar
description specified in the following directories.  Once the file is
modified, instruct the font server to reload the configuration file by
sending it the USR1 signal:

<blockquote>
<b><tt>kill -HUP</tt> <em>{pid}</em></b>
</blockquote>

<p>
where <b><em>{pid}</em></b> is the font server process's numeric process
ID, as obtained with the "<b><tt>ps</tt></b>" command. Be sure to check
that the server is still alive after signaling it: it is very picky and
could decide to shut itself down if something is wrong in the new
configuration. If this happens, restart the server by hand and try to
figure out from its output what's happening. If the font server dies,
display servers using it will experience problems, so be sure to send the
signal from the console or from a display not using that font server!

<h4><a name="Configure_Xfree86"></a>Xfree86 display servers</h4>

<p><a name="Xfree86_fontpath"></a>
With the family of Xfree86 display servers, adding a new font directory
permanently requires editing the "<b><tt>/etc/XF86Config</tt></b>" setup
file to add a new "<b><tt>FontPath</tt></b>" to the "<b><tt>Files</tt></b>"
section:

<blockquote>
<b><tt>Section "Files"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RgbPath&nbsp;&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/rgb"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/local/share/Ghostscript/fonts"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/misc:unscaled"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/Type1"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/Speedo"
<br>EndSection</tt></b>
</blockquote>

<p>
The fonts are searched in the order the directories are specified, so an
XLFD mapped by the Ghostscript directory could shadow a previous similar
description specified in the following directories.  Once this global
configuration is edited, the new fonts become available to all Xfree86
servers in use on that host. If a server is running, it must be restarted
to take effect: just quit the current session in the usual way.  If the
server is under the control of <b><tt>xdm</tt></b>, you may have to kill
it, because it is usually reset only between successive sessions.

<p>
This section by Bertrand Petit
&lt;<a href="mailto:eegs@phoe.frmug.org">eegs@phoe.frmug.org</a>&gt;

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996, 1997, 1998, 1999, 2000 Aladdin
Enterprises. All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
                                                                                                                                                                                                                                                                                                                                                                                                                
*"|r$H$89#4!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                /* This is the default Ghostscript stylesheet */

body
{
  color: black;
  background-color: white;
}

h1,h2,h3,h4,h5,h6
{
  font-family: sans-serif;
}

/* This needs a patched html file else you have it all over the place */
/* we only want this for the "visual header" at the page top */
h1
{
  text-align: center;
  background-color: #CCCC00;
}

/* Number the h2/h3 -- doesn't work on v4/5 browsers */
h2
{
   counter-increment: h2-count;
   counter-reset:     h3-count;
}

h2:before
{
   content: counter(h2-count) " ";
}

h3
{
   counter-increment: h3-count;
}

h3:before
{
   content: counter(h2-count) "." counter(h3-count) " ";
   
}
  
tt
{
  color: rgb(40%,24%,24%);
}

a > tt, a > b > tt
{
  color: blue;
}

a
{
  color: blue;
}

a.offsite
{
  font-style: oblique;
}

a:visited
{
  color: rgb(60%,0%,30%);
}

a:hover, a:active, a:focus
{
  background: #FFFFAA;
}

# table formatting hints
td
{
  vertical-align: top;
}
uperior /parenrightsuperior /twodotenleader /onedotenleader /zerooldstyle
  /oneoldstyle /twoo                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>People who have helped with Ghostscript</title>
<!-- $Id: Helpers.htm,v 1.33 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: helpers.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>People who have helped with Ghostscript</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<p>
Many people have contributed to the development of Ghostscript.  In the
<a href="New-user.htm#Acknowledgments">new-user documentation</a> we give special thanks to a few major contributors; here
we wish to acknowledge and thank the following other people (in
alphabetical order) who have contributed substantially to improving
Ghostscript since its inception in 1986:

<blockquote>
<dl>
<dt>Hitoshi Aida
	<dd>for help with the SunView driver
<dt>Pierre Arnaud
	<dd>for bug reports and fixes
<dt>Juan Manuel Acosta
        <dd>for LN03+ driver and fixes of arc and circle rendering on SunOS
<dt>William Bader
	<dd>for several drivers and bug reports
<dt>Alan Barclay
	<dd>for the RGB TIFF drivers
<dt>Nelson H. F. Beebe
	<dd>for testing on a wide variety of Unix architectures, and for
	the multi-architecture makefile
<dt>Karl Berry and Kathy Hargreaves
	<dd>for helping create the fonts originally distributed with
	Ghostscript
<dt>James W. Birdsall
	<dd>for the IBM ProPrinter driver
<dt>Andrew Birrell
	<dd>for a challenging application
<dt>Jan Bottorff
	<dd>for help with the Microsoft Windows driver
<dt>Tom Brosnan
	<dd>for the Desqview/X port
<dt>Philip Brown
	<dd>for the LaserJet IIID duplex additions
<dt>Tobias Burnus
	<dd>for many challenging bug reports
<dt>George Cameron
	<dd>for DeskJet 500C and 550C drivers
<dt>Maurice Castro
	<dd>a collaborator of Russell Lang's
<dt>Jeff Chua
	<dd>for the idea and first implementation of
	<b><tt>ReopenPerPage</tt></b>
<dt>Phil Conrad
	<dd>for originating the PPM utilities and the PCX and GIF drivers,
	and lots of bug reports
<dt>Michel Dagenais
	<dd>for major help with the DeskJet driver
<dt>John Desrosiers
	<dd>for the final work on the Microsoft Visual C++ makefiles,
	and for enhancements to the memory manager
<dt>Jim Dunham
	<dd>for the OpenVMS makefile
<dt>Gershon Elber
	<dd>for improvements to the BGI driver
<dt>Fritz Elfert
	<dd>for the Unix file enumeration routine
<dt>George Ferguson
	<dd>for some added man pages
<dt>Mike Ferrara
	<dd>for help with the LaserJet driver and HP-UX
<dt>Andy Fyfe
	<dd>for the BJ200 driver modifications to the BJ10e driver, and for
	the 3B1 driver
<dt>Tim Gallivan
	<dd>for a port to the Atari ST
<dt>J. Greely
	<dd>for help with the PostScript-to-ASCII filter
<dt>Gintautas Grigelionis
	<dd>for a set of XBM/XPM icons
<dt>Paul Haeberli
	<dd>for the ideas behind better color selection and trapezoid fill
	algorithms
<dt>Karl Hakimian
	<dd>for the Tek 4693d drivers
<dt>Richard Hesketh
	<dd>for GSPreview
<dt>Gunther Hess
	<dd>for the unified inkjet printer driver
<dt>Thomas Hiller
	<dd>for the Trident TVGA driver
<dt>Frans van Hoesel
	<dd>for improvements to the DeskJet driver
<dt>Berthold K. P. Horn
	<dd>for a better spot halftone screen
<dt>B. Jackowski and GUST (the Polish TeX users group)
	<dd>for improvements to the TrueType font reader, and for the
	<b><tt>tiff2ps</tt></b> and <b><tt>ttf2pf</tt></b> utilities
<dt>Jouk Jansen
	<dd>for motivating, testing, and providing some of the script
	file for the MMK/MMS build procedure
<dt>Earl Johnson
	<dd>for the motivation for the <b><tt>ps2ascii</tt></b> utility
<dt>Ray Johnston
	<dd>for a first draft of FAKEFONTS and EPSF recognition, and for
	many small bug fixes
<dt>Larry Jones
	<dd>for simplifying and improving the portability of the pthreads
	interface code
<dt>Pete Kaiser
	<dd>for beta testing, several versions of the OSF/1 font map, and
	an HTML version of the documentation
<dt>Norio Katayama
	<dd>for the first implementation of composite fonts, and for
	testing and helping debug the later implementation
<dt>Alfred Kayser
	<dd>for a DeskJet 500C driver and beta testing
<dt>Richard Keeney
	<dd>for help with the SunView driver
<dt>Markku Koppinen
	<dd>for a better circle-to-curve algorithm
<dt>Eleftherios Koutsofios
	<dd>for help with the SunView driver
<dt>Tom Lane
	<dd>for major help with adapting and integrating the IJG code
<dt>Sam Leffler
	<dd>for the original TIFF G3 driver, and for finding some subtle
	bugs in the CCITTFaxEncode filter
<dt>Jonathan Luckey
	<dd>for the high-resolution Imagewriter drivers
<dt>Ken Lunde
	<dd>for providing pointers to freely available CJKV font-related
	resource
<dt>Ian MacPhedran
	<dd>for a sixel driver
<dt>Jim Mayer
	<dd>for help with the DeskJet and LaserJet drivers
<dt>Paul McJones
	<dd>for help in identifying a variety of bugs
<dt>William L. Menninger
	<dd>for a version of the PC display state save/restore code
<dt>Richard Mlynarik
	<dd>for a nearly overwhelming volume of improvements and
	suggestions
<dt>Ulrich Mueller
	<dd>for the LN03 driver
<dt>Daniel Newman
	<dd>for major help with VMS and the CCITTFax filters
<dt>Bjorn S. Nilsson
	<dd>for major help with VMS, including many updates of the DCL
	build scripts and creating the VMS help file
<dt>Roque Donizete de Oliveira
	<dd>for testing and debugging, and a "man" page
<dt>Gerbert Orasche
	<dd>for some minor bug fixes
<dt>Marc Paquette
	<dd>for the original PaintJet driver
<dt>Hal Peterson
	<dd>for major help with BDF fonts
<dt>Andy Piper
	<dd>for the first draft of the WindowID feature
<dt>Martin Pirker
	<dd>for fixing two major problems with TrueType fonts
<dt>Tom Quinn
	<dd>for the Canon LBP-8II driver
<dt>Matthias Rabe
	<dd>for work on an OS/2 port
<dt>Jerry Roylance
	<dd>for help with statusdict
<dt>Dave St. Clair
	<dd>for the color Epson/Fujitsu driver
<dt>Jan Sanislo
	<dd>for two subtle but vital fixes
<dt>Clemens Schrimpe
	<dd>for help with accented characters
<dt>Scott Schwartz
	<dd>for improvements to <b><tt>gslp.ps</tt></b>
<dt>Mike Smolenski
	<dd>for the Sony drivers
<dt>Snoopy
	<dd>for major help with Hershey fonts, and many other contributions
<dt>Karsten Spang
	<dd>for the Tektronix 4695/4696 driver
<dt>Andreas Stolcke
	<dd>for help with the SunView driver
<dt>Hans-Gerd Straeter
	<dd>for finding many obscure bugs
<dt>Christoph Strozyk
	<dd>for getting the URW fonts made available
<dt>Alexey Subbotin
	<dd>for contributing an interface to GNU readline, and for the
	rewritten implementation of ==
<dt>Michael Sweet
	<dd>for help with the high-density Epson driver
<dt>Guenther Thomsen
	<dd>for the mid-density Epson driver
<dt>Gregg Townsend
	<dd>for the low-resolution dithering algorithm
<dt>Christian Tschudin
	<dd>for fixes to the virtual memory package, and for the original
	BubbleJet driver
<dt>Stephen Turnbull
	<dd>for help with the DesqView/X port
<dt>Jos Vos
	<dd>for the original PBM/PGM/PPM driver, and for much beta testing
<dt>Renze de Waal
	<dd>for an improvement to the "<b><tt>SAFER</tt></b>" feature
<dt>Allan Wax
	<dd>for the AT&amp;T 6300 modification to the BGI driver
<dt>Mark Wedel
	<dd>for the Apple DMP driver
<dt>David Wexelblat
	<dd>for the high-resolution 9-pin Epson driver
<dt>George N. White III
	<dd>for testing the PDF writer and contributing documentation
<dt>Elizabeth Zwicky
	<dd>for some very challenging examples
</dl>
</blockquote>

<p>
The following people have also helped out by beta testing, by reporting
bugs and/or fixes, or in other ways:

<blockquote>
Vikas Aggarwal, Michael Almond,
Abramo Bagnara, Malcolm Bennett, David Brooks,
Alex Cherepanov, Jim Collins,
Peter da Silva, Art Dederick, Paul DuBois,
Toerless Eckert,
Bernhard Fabricius, Mark Friedman, Richard Foulk,
Glenn Geers, Dave Goldblatt, Ben Goren, Dirk Grunwald,
Lars Haakedal, Howard B. Halstead, Adam Hammer, George Hartzell, Mike Hoffmann, Charles Hulse,
Brad Jones, Terry Jones,
David Keppel,
Anthony Lee, Marty Leisner, John Lundin Jr., Lee McLoughlin,
Stergios Marinopoulos, Herb Martin, David Mathog, David Maynard, Doug McDonald, Rich Murphey,
Russ Nelson,
Peter Phillips,
Mark Rawling, Philippe Robert, Tomas Rokicki, Wolfgang Rupprecht,
Bill Schelter, Larry Schwimmer, Bakul Shah,
Erik Talvola, Henrik Theiling, Mark A. Thomas, Kjetil Bernhard Thomassen,
Amanda Walker, Peter Wan, John L. Wehle, Carsten Wiethoff, Carl Witty,
Frank Yellin,
Jamie Zawinski
</blockquote>

<p>
If your name appears on the above list and we've omitted a particular
contribution you made, or if we've accidentally overlooked you entirely,
please forgive us: just let us know at <a href="mailto:raph@artofcode.com">raph@artofcode.com</a>, and you will be
properly acknowledged in the next release.

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996, 1997, 1998 Aladdin Enterprises.  All
rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
st enough to extract the seac information.
% We assume that the only possible operators are hsbw, sbw, and seac,
% and that there are no 5-byte numbers.
	 mark 0 3 -1 roll
	  { exch
	     { { dup 32 lt
	          { pop 0 }
		  { dup 247 lt
		     { 139 sub 0 }
		     { dup 251 lt
			{ 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Hershey fonts for Ghostscript</title>
<!-- $Id: Hershey.htm,v 1.5 2002/02/21 21:36:33 giles Exp $ -->
<!-- Originally: hershey.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>Hershey fonts for Ghostscript</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>
This file, unlike the rest of Ghostscript, consists entirely of information
copied from public sources.  It therefore is not covered by the
Ghostscript copyright or license: it is in the public domain.

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>. You can also read about <a href="Fonts.htm">Ghostscript
fonts</a> in general.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<pre>
Mod.sources:  Volume 4, Issue 42
Submitted by: pyramid!octopus!pete (Pete Holzmann)

This is part 1 of five parts of the first Usenet distribution of
the Hershey Fonts. See the README file for more details.

Peter Holzmann, Octopus Enterprises
USPS: 19611 La Mar Court, Cupertino, CA 95014
UUCP: {hplabs!hpdsd,pyramid}!octopus!pete
Phone: 408/996-7746

This distribution is made possible through the collective encouragement
of the Usenet Font Consortium, a mailing list that sprang to life to get
this accomplished and that will now most likely disappear into the mists
of time... Thanks are especially due to Jim Hurt, who provided the packed
font data for the distribution, along with a lot of other help.

This file describes the Hershey Fonts in general, along with a description of
the other files in this distribution and a simple re-distribution restriction.

USE RESTRICTION:
        This distribution of the Hershey Fonts may be used by anyone for
        any purpose, commercial or otherwise, providing that:
                1. The following acknowledgements must be distributed with
                        the font data:
                        - The Hershey Fonts were originally created by Dr.
                                A. V. Hershey while working at the U. S.
                                National Bureau of Standards.
                        - The format of the Font data in this distribution
                                was originally created by
                                        James Hurt
                                        Cognition, Inc.
                                        900 Technology Park Drive
                                        Billerica, MA 01821
                                        (mit-eddie!ci-dandelion!hurt)
                2. The font data in this distribution may be converted into
                        any other format *EXCEPT* the format distributed by
                        the U.S. NTIS (which organization holds the rights
                        to the distribution and use of the font data in that
                        particular format). Not that anybody would really
                        *want* to use their format... each point is described
                        in eight bytes as "xxx yyy:", where xxx and yyy are
                        the coordinate values as ASCII numbers.

*PLEASE* be reassured: The legal implications of NTIS' attempt to control
a particular form of the Hershey Fonts *are* troubling. HOWEVER: We have
been endlessly and repeatedly assured by NTIS that they do not care what
we do with our version of the font data, they do not want to know about it,
they understand that we are distributing this information all over the world,
etc etc etc... but because it isn't in their *exact* distribution format, they
just don't care!!! So go ahead and use the data with a clear conscience! (If
you feel bad about it, take a smaller deduction for something on your taxes
next week...)

The Hershey Fonts:
        - are a set of more than 2000 glyph (symbol) descriptions in vector
                ( &lt;x,y&gt; point-to-point ) format
        - can be grouped as almost 20 'occidental' (english, greek,
                cyrillic) fonts, 3 or more 'oriental' (Kanji, Hiragana,
                and Katakana) fonts, and a few hundred miscellaneous
                symbols (mathematical, musical, cartographic, etc etc)
        - are suitable for typographic quality output on a vector device
                (such as a plotter) when used at an appropriate scale.
        - were digitized by Dr. A. V. Hershey while working for the U.S.
                Government National Bureau of Standards (NBS).
        - are in the public domain, with a few caveats:
                - They are available from NTIS (National Technical Info.
                        Service) in a computer-readable from which is *not*
                        in the public domain. This format is described in
                        a hardcopy publication "Tables of Coordinates for
                        Hershey's Repertory of Occidental Type Fonts and
                        Graphic Symbols" available from NTIS for less than
                        $20 US (phone number +1 703 487 4763).
                - NTIS does not care about and doesn't want to know about
                        what happens to Hershey Font data that is not
                        distributed in their exact format.
                - This distribution is not in the NTIS format, and thus is
                        only subject to the simple restriction described
                        at the top of this file.

Hard Copy samples of the Hershey Fonts are best obtained by purchasing the
book described above from NTIS. It contains a sample of all of the Occidental
symbols (but none of the Oriental symbols).

This distribution:
        - contains
                * a complete copy of the Font data using the original
                        glyph-numbering sequence
                * a set of translation tables that could be used to generate
                        ASCII-sequence fonts in various typestyles
                * a couple of sample programs in C and Fortran that are
                        capable of parsing the font data and displaying it
                        on a graphic device (we recommend that if you
                        wish to write programs using the fonts, you should
                        hack up one of these until it works on your system)

        - consists of the following files...
                hershey.doc - details of the font data format, typestyles and
                                symbols included, etc.
                hersh.oc[1-4] - The Occidental font data (these files can
                                        be catenated into one large database)
                hersh.or[1-4] - The Oriental font data (likewise here)
                *.hmp - Occidental font map files. Each file is a translation
                                table from Hershey glyph numbers to ASCII
                                sequence for a particular typestyle.
                hershey.f77 - A fortran program that reads and displays all
                                of the glyphs in a Hershey font file.
                hershey.c   - The same, in C, using GKS, for MS-DOS and the
                                PC-Color Graphics Adaptor.

Additional Work To Be Done (volunteers welcome!):

        - Integrate this complete set of data with the hershey font typesetting
                program recently distributed to mod.sources
        - Come up with an integrated data structure and supporting routines
                that make use of the ASCII translation tables
        - Digitize additional characters for the few places where non-ideal
                symbol substitutions were made in the ASCII translation tables.
        - Make a version of the demo program (hershey.c or hershey.f77) that
                uses the standard Un*x plot routines.
        - Write a banner-style program using Hershey Fonts for input and
                non-graphic terminals or printers for output.
        - Anything else you'd like!

This file provides a brief description of the contents of the Occidental
Hershey Font Files. For a complete listing of the fonts in hard copy, order
NBS Special Publication 424, "A contribution to computer typesetting
techniques: Tables of Coordinates for Hershey's Repertory of Occidental
Type Fonts and Graphic Symbols". You can get it from NTIS (phone number is
+1 703 487 4763) for less than twenty dollars US.

Basic Glyph (symbol) data:

        hersh.oc1       - numbers 1 to 1199
        hersh.oc2       - numbers 1200 to 2499
        hersh.oc3       - numbers 2500 to 3199
        hersh.oc4       - numbers 3200 to 3999

        These four files contain approximately 19 different fonts in
the A-Z alphabet plus greek and cyrillic, along with hundreds of special
symbols, described generically below.

        There are also four files of Oriental fonts (hersh.or[1-4]). These
files contain symbols from three Japanese alphabets (Kanji, Hiragana, and
Katakana). It is unknown what other symbols may be contained therein, nor
is it known what order the symbols are in (I don't know Japanese!).

        Back to the Occidental files:

Fonts:
        Roman: Plain, Simplex, Duplex, Complex Small, Complex, Triplex
        Italic: Complex Small, Complex, Triplex
        Script: Simplex, Complex
        Gothic: German, English, Italian
        Greek: Plain, Simplex, Complex Small, Complex
        Cyrillic: Complex

Symbols:
        Mathematical (227-229,232,727-779,732,737-740,1227-1270,2227-2270,
                        1294-1412,2294-2295,2401-2412)
        Daggers (for footnotes, etc) (1276-1279, 2276-2279)
        Astronomical (1281-1293,2281-2293)
        Astrological (2301-2312)
        Musical (2317-2382)
        Typesetting (ffl,fl,fi sorts of things) (miscellaneous places)
        Miscellaneous (mostly in 741-909, but also elsewhere):
                - Playing card suits
                - Meteorology
                - Graphics (lines, curves)
                - Electrical
                - Geometric (shapes)
                - Cartographic
                - Naval
                - Agricultural
                - Highways
                - Etc...

ASCII sequence translation files:

        The Hershey glyphs, while in a particular order, are not in an
        ASCII sequence. I have provided translation files that give the
        sequence of glyph numbers that will most closely approximate the
        ASCII printing sequence (from space through ~, with the degree
        circle tacked on at the end) for each of the above fonts:

        File names are made up of fffffftt.hmp,

                where ffffff is the font style, one of:
                        roman   Roman
                        greek   Greek
                        italic  Italic
                        script  Script
                        cyril   Cyrillic (some characters not placed in
                                           the ASCII sequence)
                        gothgr  Gothic German
                        gothgb  Gothic English
                        gothit  Gothic Italian

                and tt is the font type, one of:
                    p       Plain (very small, no lower case)
                    s       Simplex (plain, normal size, no serifs)
                    d       Duplex (normal size, no serifs, doubled lines)
                    c       Complex (normal size, serifs, doubled lines)
                    t       Triplex (normal size, serifs, tripled lines)
                    cs      Complex Small (Complex, smaller than normal size)

The three sizes are coded with particular base line (bottom of a capital
        letter) and cap line (top of a capital letter) values for 'y':

        Size            Base Line       Cap Line

        Very Small         -5              +4
        Small              -6              +7
        Normal             -9              +12

        (Note: some glyphs in the 'Very Small' fonts are actually 'Small')

The top line and bottom line, which are normally used to define vertical
        spacing, are not given. Maybe somebody can determine appropriate
        values for these!

The left line and right line, which are used to define horizontal spacing,
        are provided with each character in the database.

Format of Hershey glyphs:

5 bytes - glyphnumber
3 bytes - length of data  length in 16-bit words including left&amp;right numbers
1 byte  - x value of left margin
1 byte  - x value of right margin
(length*2)-2 bytes      - stroke data

left&amp;right margins and stroke data are biased by the value of the letter 'R'
Subtract the letter 'R' to get the data.

e.g. if the data byte is 'R', the data is 0
     if the data byte is 'T', the data is +2
     if the data byte is 'J', the data is -8

and so on...

The coordinate system is x-y, with the origin (0,0) in the center of the
glyph.  X increases to the right and y increases *down*.

The stroke data is pairs of bytes, one byte for x followed by one byte for y.

An 'R' in the stroke data indicates a 'lift pen and move' instruction.
</pre>

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->

<hr>

<p>
<small>Public Domain.</small>
<small>Distributed with Ghostscript 6.50, November 2000</small>

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
 INITIAL DSTACK ******
  countdictstack array dictstack
   { dup gcheck not { exit } if pop } forall
		% Create localdicts with a l                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>History of Ghostscript versions 1.n</title>
<!-- $Id: History1.htm,v 1.29 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: history1.txt -->
<!--
	WARNING: do not use Pete Kaiser's emacs function "gs-toc" alone to
	re-create the table of contents here, because it will replace the
	hand-edited TOC subheads with a separate subhead for each H2 in
	the body of the file.  Or if you do, first look at the original
	TOC to see how to edit it for visual conciseness.
-->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>History of Ghostscript versions 1.n</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Version1.3">Version 1.3 (6/20/89)</a>
<ul>
<li><a href="#V1.3_Interpreter">Interpreter</a>,
    <a href="#V1.3_Fonts">Fonts</a>,
    <a href="#V1.3_Library">Library</a>,
    <a href="#V1.3_Usage_procedures">Usage procedures</a>
</ul>
<li><a href="#Version1.2">Version 1.2 (2/22/89)</a>
<ul>
<li><a href="#V1.2_Interpreter">Interpreter</a>,
    <a href="#V1.2_Library">Library</a>,
    <a href="#V1.2_Usage_procedures">Usage procedures</a>
</ul>
<li><a href="#Version1.1">Version 1.1 (2/12/89)</a>
<ul>
<li><a href="#V1.1_Interpreter">Interpreter</a>,
    <a href="#V1.1_Initialization">Initialization (ghost.ps, gfonts.ps)</a>,
    <a href="#V1.1_Library">Library</a>,
    <a href="#V1.1_Usage_procedures">Usage procedures</a>
</ul>
<li><a href="#Version1.0">Version 1.0 (8/11/88)</a>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>
This document is a history of Ghostscript releases numbered 1.n.  For more
recent changes, see the the other history documents and, for the latest
versions, the news:

<blockquote>
<a href="News.htm">News</a><br>
<a href="History4.htm">History of Ghostscript versions 4.n</a><br>
<a href="History3.htm">History of Ghostscript versions 3.n</a><br>
<a href="History2.htm">History of Ghostscript versions 2.n</a><br>
History of Ghostscript versions 1.n (this document)<br>
</blockquote>

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->


<h2><a name="Version1.3"></a>Version 1.3 (6/20/89)</h2>
<pre>
This release should have had a lot more things in it, but time pressure
and the already long delay in getting it out made it necessary to push it
out the door in an incomplete state (e.g., no testing on X systems
whatsoever).

</pre>
<h3><a name="V1.3_Interpreter"></a>Interpreter</h3>

<pre>
Makes -d and -D equivalent on the command line.  Adds a new switch -s / -S
that defines a name as a string rather than a token.

Arranges things so that if -sLIB=_a_prefix_ is defined on the command
line, (filename) run will look for _a_prefix_filename before giving up if
filename isn't the name of an accessible file.

Changes showpage from an operator to a procedure.  The definition of
showpage in ghost.ps does a copypage, beeps the console, waits for the
user to type a character (normally a &lt;return&gt;, since line buffering is
always enabled), and then does an erasepage and an initgraphics.

Adds a new initialization file, gdevs.ps, containing device-dependent
parameters.  The default window size for X Windows is properly set to 612
x 792, i.e., 8.5" x 11".

Adds a new optional initialization file, statusd.ps, that provides dummy
definitions for the names found in statusdict on LaserWriters.

Adds a new operator, getenv, to get information from the shell
environment.

Adds a new predefined operator, defaultdevicename, that returns either (X)
or (EGA) according to how the interpreter was built.

Adds a new type, devicetype, and new operators deviceparams, getscanlines,
makedevice, makeimagedevice, and setdevice.  Changes currentdevice to
return a device object rather than a set of parameters.

Makes the scanner recognize reals with 'e' exponent notation, and handle
reals with more than 9 digits.

Fixes a bug that made names starting with digits read incorrectly.

Fixes a bug in the exp operator that made it not pop its first argument
from the stack.

Fixes a bug in the rand operator that made it return negative values about
half the time.

Fixes a bug in equality comparison (eq, ne, and several other operators)
that made unequal operator objects occasionally appear to be equal on DOS
systems.

Fixes a bug in the bind operator that made it not work on packed arrays.

Changes the internal representation of dictionaries so they can be
expanded or contracted dynamically.  Adds a new operator, setmaxlength, to
change the allocated size of a dictionary.

Changes sstorei.h so that non-DOS compilers don't encounter the #pragma
directive used by Turbo C.

Restores the display mode (on MS-DOS systems) when exiting.

</pre>
<h3><a name="V1.3_Fonts"></a>Fonts</h3>

<pre>
Makes undefined characters in the standard font display as tilde rather
than blank (or causing an error).  Unmapped character codes (those mapped
to .notdef in the encoding) still display as nothing, per the PostScript
manual.

</pre>
<h3><a name="V1.3_Library"></a>Library</h3>

<pre>
Adds a new header file, gxbitmap.h, with some new documentation describing
the internal storage format for bitmaps.

Makes numerous internal changes in the character / font cache, affecting
many of the routines in gxcache.c.

Fixes a bug in gz_draw_line / gz_fill_trapezoid that made nearly
horizontal lines display wrong.

Fixes a bug in gs_scale that made scaling not work if the coordinate
system was rotated or skewed.

Extends the font cache so it will handle characters rotated by multiples
of 90 degrees.

Changes the second argument of gx_path_bbox and gx_path_is_rectangle to be
a gs_fixed_rect * rather than a fixed [4].

Changes gs_matrix_rotate so it handles multiples of 90 degrees as a
special case.

Changes the definition of the gx_device structure to accommodate the new
device operators, and adds corresponding library calls.

Changes the type for a device color index from int to gx_color_index
(equivalent to unsigned long).  ***NOTE***: this affects existing clients
and drivers in a non-trivial way on MS-DOS systems.

Changes gs_malloc and gs_free to take a client name string as an argument.

</pre>
<h3><a name="V1.3_Usage_procedures"></a>Usage procedures</h3>

<pre>
Changes the compilation rules for Unix systems to not use the -o and -c
compiler flags together, to be compatible with more versions of cc.

Changes the gcc makefile to use $(GCC) rather than gcc as the compiler
name.

Moves the -1 flag for the MS-DOS compiler from the cc*.bat files to the
makefile.

Changes CCDEBUG to CCFLAGS, and adds ASMFLAGS, in DOS makefile.

Adds -DFOR80386 and /DFOR80386 to enable use of 80386 instructions in
assembly code on DOS systems.

Merges the DEBUG and gs_DEBUG switches.  There is now only a single DEBUG
switch that affects both the interpreter and the library.

Adds a new compilation switch, -DNOPRIVATE, that makes private (static)
variables and procedures public for debugging and profiling (only needed
on DOS systems).

Adds the DOS executable (gs.exe and gs.map) to the distribution fileset.

Adds new platform-specific code files, gp-*.c, for a few things like
reading the clock.

Adds a new documentation file, drivers.doc, that describes the interface
between Ghostscript and device drivers.

</pre>

<hr>

<h2><a name="Version1.2"></a>Version 1.2 (2/22/89)</h2>

<h3><a name="V1.2_Interpreter"></a>Interpreter</h3>

<pre>
Adds the new facilities in version 25 of PostScript: //name for immediate
lookup, packed arrays (setpacking, currentpacking, packedarray operators),
and new font cache parameters (setcacheparams, currentcacheparams
operators).

Adds new operators (setfileposition, currentfileposition) for random
access to files.

Extends readhexstring to take either a string or a file, just like token.

Fixes a bug that caused the 'for' operator (and a couple of others) to
randomly smash memory locations on PC platforms.

</pre>
<h3><a name="V1.2_Library"></a>Library</h3>

<pre>
Renames the init_device driver procedure as open_device, and adds a
corresponding close_device.

Adds new procedures to read and set the cache limit values (implementing
the currentcacheparams and setcacheparams operators).

</pre>
<h3><a name="V1.2_Usage_procedures"></a>Usage procedures</h3>

<pre>
Changes the name of the Unix makefile to ux-cc-x.mak, and adds a new Unix
makefile, ux-gcc-x.mak, for using gcc instead of cc.  (The latter doesn't
actually work yet.)

Changes the name of the single built-in font from uglyfont.cp to
ugly10.cp.

</pre>

<hr>

<h2><a name="Version1.1"></a>Version 1.1 (2/12/89)</h2>

<h3><a name="V1.1_Interpreter"></a>Interpreter</h3>

<pre>
Makes the scanner treat ^Z (ASCII code 26) as whitespace: it erroneously
treated ^R (ASCII code 22, or octal 26) as whitespace.

Makes the token and readline operators, and the syntax for comments,
recognize \r (code 13), \n (code 10), and \r\n as equivalent end-of-line
indicators.  The token and readline operators will skip over any of these
sequences at the end of a token or line respectively, and a comment will
read through any of these sequences.  The other file operators (read,
write, readstring, writestring) do nothing special with these characters.

Changes the debug switch name from -D to -Z.  Adds a -D switch for
defining names in systemdict from the command line.  Defines -DDEBUG for
printing out debugging information during initialization, and -DNODISPLAY
for suppressing display output.

Corrects a bug that prevented the error machinery from working -- in
version 1.0, errors always dumped the stacks and aborted interpretation.

Corrects a bug that made eq and ne not work for strings.

Makes the atan (arctangent) operator normalize its results according to
the PostScript convention.

Makes the div operator check for zero divisor.

Makes unimplemented operators (resetfile, echo, save, restore, strokepath,
reversepath) truly undefined.

Makes the interactive loop exit gracefully on end-of-file: in version 1.0
this caused an infinite loop.

Implements the status operator.

Corrects a bug that made the 'for' operator deliver garbage values if one
or more of the operands (start, increment, end) was a real.

Corrects a bug that made the arc and arcn operators not pop their operands
from the stack.

Corrects a bug that made the kshow operator crash the interpreter.

Corrects a bug that made the print operator fail on machines that don't
pass structure arguments by simply pushing the contents of the structure.

Adds a new operator, imagecharpath, to convert images to
addcharpath-compatible outlines.

Changes alloc and alloc_free to use char * rather than byte *, and
alloc_free to return void rather than int, making them compatible with the
library's expectations and with malloc/free.

Explicitly casts all expressions of the form (ptr1 - ptr2) used as
procedure arguments to unsigned, to handle an incompatibility between
Turbo C versions 1.5 and 2.0.

Changes some of the internal conventions for operators: operators that
push on the operand stack must check for overflow explicitly, and
operators that modify the execution stack must return a special code.
(See oper.h for details.)

</pre>
<h3><a name="V1.1_Initialization"></a>Initialization (ghost.ps, gfonts.ps)</h3>

<pre>
Modifies ghost.ps and gfonts.ps so they print debugging information only
if the name DEBUG is defined.  (Presumably the user will set this from the
command line with -DDEBUG.)

Changes ghost.ps so it initializes the nominal screen size to 640 x 350 on
MS-DOS systems as before, but to 612 x 792 on Unix systems, which is an
8.5" x 11" page at 72 pixels per inch.

</pre>
<h3><a name="V1.1_Library"></a>Library</h3>

<pre>
Corrects a bug that made the fill and eofill operators (gs_fill and
gs_eofill) not perform a newpath afterward.

Corrects the bug that made thin, nearly horizontal lines display wrong (as
a series of disconnected dots) in the MS-DOS implementation.

Fixes a bug in the EGA driver that often made it fill rectangular regions
with black around information being displayed in white.

Completely changes the internal representation of outline fonts, and
changes btoi.ps (a Ghostscript language program for converting bitmaps to
outlines) to use a new library call, gs_imagecharpath.

Changes the extension for outline font files from .gf to .cp.

Adds a new debugging switch, q, that traces all rectangle fill operations.

Adds a new debugging switch, v, that traces all device-level output calls.

Explicitly casts pointer differences passed as procedure arguments, as in
the interpreter.

Makes stringwidth work if there is no current point.  In version 1.0, this
gave a nocurrentpoint error.

</pre>
<h3><a name="V1.1_Usage_procedures"></a>Usage procedures</h3>

<pre>
Changes the name of the 'read me' file from READ.ME to README.

Removes a bogus line (invoking the 'mcopy' utility) from the makefile.

Splits up the makefile into a generic part (ghost.mak) and
platform-specific parts (dos-ega.mak, unix-x11.mak).  The latter are what
is actually executed.

Puts the definitions of the DEBUG and gs_DEBUG compilation flags into the
makefile instead of in ghost.h and gx.h respectively.

Changes the names of the documentation files to be a little less cryptic.
Changes all the file names to lower-case in the documentation.  Adds
installation information to make.doc.

Changes all function definitions (but not prototype declarations) to ANSI
syntax, and adds a preprocessing step (ansi2knr) to convert them to K&amp;R
syntax on Unix systems.

Changes the normal MS-DOS link configuration to not assume the presence of
an 80x87 coprocessor, and describes how to increase performance if a
coprocessor is present.

Changes the names of all the interpreter .c files, except stream.c, to
begin with 'i'.

</pre>

<hr>

<h2><a name="Version1.0"></a>Version 1.0 (8/11/88)</h2>

<pre>
First version released to the public.
</pre>

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p><small>Copyright &copy; 1996, 1997, 1998 Aladdin Enterprises.
All rights reserved.</small>

<p>This software is provided AS-IS with no warranty, either express or
<p>implied.
<p>
<p>This software is distributed under license and may not be copied,
<p>modified or distributed except as expressly authorized under the terms
<p>of the license contained in the file LICENSE in this distribution.
<p>
<p>For more information about licensing, please refer to
<p>http://www.ghostscript.com/licensing/. For information on
<p>commercial licensing, go to http://www.artifex.com/licensing/ or
<p>contact Artifex Software, Inc., 101 Lucas Valley Road #110,
<p>San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
rrentcolorscreen	% - currentcolorscreen (60 0 <dict>)*4
	{ .currenthalftone
	   { { .fixcurrenthalftonescreen 3 copy 6 copy }	% halftone
	     { 3 copy 6 copy }			% screen
	     { }				% colorscreen
	   }
	  exch get exec
	} odef

% ------ User objects ------ %

/.UserObjects                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>History of Ghostscript versions 1.n</title>
<!-- $Id: History2.htm,v 1.29 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: history2.txt -->
<!--
	WARNING: do not use Pete Kaiser's emacs function "gs-toc" alone to
	re-create the table of contents here, because it will replace the
	hand-edited TOC subheads with a separate subhead for each H2 in
	the body of the file.  Or if you do, first look at the original
	TOC to see how to edit it for visual conciseness.
-->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>History of Ghostscript versions 2.n</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Version2.9.10b">Version 2.9.10-beta (7/28/94)</a>
<ul>
<li><a href="#V2.9.10b_Documentation">Documentation</a>,
    <a href="#V2.9.10b_Procedures">Procedures</a>,
    <a href="#V2.9.10b_Utilities">Utilities</a>,
    <a href="#V2.9.10b_Drivers">Drivers</a>,
    <a href="#V2.9.10b_Platforms">Platforms</a>,
    <a href="#V2.9.10b_Fonts">Fonts</a>,
    <a href="#V2.9.10b_Interpreter">Interpreter</a>,
    <a href="#V2.9.10b_Streams">Streams</a>,
    <a href="#V2.9.10b_Library">Library</a>
</ul>
<li><a href="#Version2.9.9b">Version 2.9.9-beta (6/23/94)</a>
<ul>
<li><a href="#V2.9.9b_Documentation">Documentation</a>,
    <a href="#V2.9.9b_Platforms">Platforms</a>,
    <a href="#V2.9.9b_Fonts">Fonts</a>,
    <a href="#V2.9.9b_Interpreter">Interpreter</a>,
    <a href="#V2.9.9b_Library">Library</a>
</ul>
<li><a href="#Version2.9.8">Version 2.9.8 (6/20/94)</a>
<ul>
<li><a href="#V2.9.8_Documentation">Documentation</a>,
    <a href="#V2.9.8_Procedures">Procedures</a>,
    <a href="#V2.9.8_Utilities">Utilities</a>,
    <a href="#V2.9.8_Drivers">Drivers</a>,
    <a href="#V2.9.8_Platforms">Platforms</a>,
    <a href="#V2.9.8_Fonts">Fonts</a>,
    <a href="#V2.9.8_Interpreter">Interpreter</a>,
    <a href="#V2.9.8_Library">Library</a>
</ul>
<li><a href="#Version2.9.7b">Version 2.9.7-beta (6/5/94)</a>
<ul>
<li><a href="#V2.9.7b_Documentation">Documentation</a>,
    <a href="#V2.9.7b_Procedures">Procedures</a>,
    <a href="#V2.9.7b_Utilities">Utilities</a>,
    <a href="#V2.9.7b_Drivers">Drivers</a>,
    <a href="#V2.9.7b_Platforms">Platforms</a>,
    <a href="#V2.9.7b_Fonts">Fonts</a>,
    <a href="#V2.9.7b_Interpreter">Interpreter</a>,
    <a href="#V2.9.7b_Library">Library</a>
</ul>
<li><a href="#Version2.9.6b">Version 2.9.6-beta (5/23/94, not distributed to the public)</a>
<ul>
<li><a href="#V2.9.6b_Documentation">Documentation</a>,
    <a href="#V2.9.6b_Procedures">Procedures</a>,
    <a href="#V2.9.6b_Utilities">Utilities</a>,
    <a href="#V2.9.6b_Drivers">Drivers</a>,
    <a href="#V2.9.6b_Platforms">Platforms</a>,
    <a href="#V2.9.6b_Fonts">Fonts</a>,
    <a href="#V2.9.6b_Interpreter">Interpreter</a>,
    <a href="#V2.9.6b_Library">Library</a>
</ul>
<li><a href="#Version2.9.5b">Version 2.9.5-beta (4/11/94)</a>
<ul>
<li><a href="#V2.9.5b_Documentation">Documentation</a>,
    <a href="#V2.9.5b_Procedures">Procedures</a>,
    <a href="#V2.9.5b_Utilities">Utilities</a>,
    <a href="#V2.9.5b_Drivers">Drivers</a>,
    <a href="#V2.9.5b_Platforms">Platforms</a>,
    <a href="#V2.9.5b_Interpreter">Interpreter</a>,
    <a href="#V2.9.5b_Library">Library</a>
</ul>
<li><a href="#Version2.9.4b">Version 2.9.4-beta (2/19/94)</a>
<ul>
<li><a href="#V2.9.4b_Procedures">Procedures</a>,
    <a href="#V2.9.4b_Utilities">Utilities</a>,
    <a href="#V2.9.4b_Drivers">Drivers</a>,
    <a href="#V2.9.4b_Platforms">Platforms</a>,
    <a href="#V2.9.4b_Interpreter">Interpreter</a>,
    <a href="#V2.9.4b_Library">Library</a>
</ul>
<li><a href="#Version2.9.3b">Version 2.9.3-beta (1/19/94)</a>
<ul>
<li><a href="#V2.9.3b_Documentation">Documentation</a>,
    <a href="#V2.9.3b_Procedures">Procedures</a>,
    <a href="#V2.9.3b_Drivers">Drivers</a>,
    <a href="#V2.9.3b_Platforms">Platforms</a>,
    <a href="#V2.9.3b_Interpreter">Interpreter</a>,
    <a href="#V2.9.3b_Library">Library</a>
</ul>
<li><a href="#Version2.9.2b">Version 2.9.2-beta (1/2/94)</a>
<ul>
<li><a href="#V2.9.2b_Documentation">Documentation</a>,
    <a href="#V2.9.2b_Utilities">Utilities</a>,
    <a href="#V2.9.2b_Drivers">Drivers</a>,
    <a href="#V2.9.2b_Platforms">Platforms</a>,
    <a href="#V2.9.2b_Fonts">Fonts</a>,
    <a href="#V2.9.2b_Interpreter">Interpreter</a>,
    <a href="#V2.9.2b_Library">Library</a>
</ul>
<li><a href="#Version2.9.1b">Version 2.9.1-beta (12/7/93)</a>
<ul>
<li><a href="#V2.9.1b_Utilities">Utilities</a>,
    <a href="#V2.9.1b_Interpreter">Interpreter</a>,
    <a href="#V2.9.1b_Library">Library</a>
</ul>
<li><a href="#Version2.9b">Version 2.9-beta (12/6/93)</a>
<ul>
<li><a href="#V2.9b_Documentation">Documentation</a>,
    <a href="#V2.9b_Procedures">Procedures</a>,
    <a href="#V2.9b_Utilities">Utilities</a>,
    <a href="#V2.9b_Drivers">Drivers</a>,
    <a href="#V2.9b_Platforms">Platforms</a>,
    <a href="#V2.9b_Interpreter">Interpreter</a>,
    <a href="#V2.9b_Library">Library</a>
</ul>
<li><a href="#Version2.8b">Version 2.8-beta (11/10/93)</a>
<ul>
<li><a href="#V2.8b_Documentation">Documentation</a>,
    <a href="#V2.8b_Procedures">Procedures</a>,
    <a href="#V2.8b_Utilities">Utilities</a>,
    <a href="#V2.8b_Drivers">Drivers</a>,
    <a href="#V2.8b_Platforms">Platforms</a>,
    <a href="#V2.8b_Fonts">Fonts</a>,
    <a href="#V2.8b_Interpreter">Interpreter</a>,
    <a href="#V2.8b_Library">Library</a>
</ul>
<li><a href="#Version2.7.2b">Version 2.7.2-beta (10/11/93)</a>
<ul>
<li><a href="#V2.7.2b_Utilities">Utilities</a>,
    <a href="#V2.7.2b_Interpreter">Interpreter</a>,
    <a href="#V2.7.2b_Library">Library</a>
</ul>
<li><a href="#Version2.7.1b">Version 2.7.1-beta (10/4/93, not distributed to the public)</a>
<ul>
<li><a href="#V2.7.1b_Documentation">Documentation</a>,
    <a href="#V2.7.1b_Utilities">Utilities</a>,
    <a href="#V2.7.1b_Drivers">Drivers</a>,
    <a href="#V2.7.1b_Platforms">Platforms</a>,
    <a href="#V2.7.1b_Fonts">Fonts</a>,
    <a href="#V2.7.1b_Interpreter">Interpreter</a>,
    <a href="#V2.7.1b_Library">Library</a>
</ul>
<li><a href="#Version2.7b">Version 2.7-beta (9/20/93, not distributed to the public)</a>
<ul>
<li><a href="#V2.7b_Documentation">Documentation</a>,
    <a href="#V2.7b_Procedures">Procedures</a>,
    <a href="#V2.7b_Utilities">Utilities</a>,
    <a href="#V2.7b_Drivers">Drivers</a>,
    <a href="#V2.7b_Platforms">Platforms</a>,
    <a href="#V2.7b_Fonts">Fonts</a>,
    <a href="#V2.7b_Interpreter">Interpreter</a>,
    <a href="#V2.7b_Library">Library</a>
</ul>
<li><a href="#Version2.6.1">Version 2.6.1 (5/28/93)</a>
<ul>
<li><a href="#V2.6.1_Documentation">Documentation</a>,
    <a href="#V2.6.1_Procedures">Procedures</a>,
    <a href="#V2.6.1_Utilities">Utilities</a>,
    <a href="#V2.6.1_Drivers">Drivers</a>,
    <a href="#V2.6.1_Platforms">Platforms</a>,
    <a href="#V2.6.1_Fonts">Fonts</a>,
    <a href="#V2.6.1_Interpreter">Interpreter</a>,
    <a href="#V2.6.1_Library">Library</a>
</ul>
<li><a href="#Version2.6">Version 2.6 (5/9/93)</a>
<ul>
<li><a href="#V2.6_Documentation">Documentation</a>,
    <a href="#V2.6_Procedures">Procedures</a>,
    <a href="#V2.6_Utilities">Utilities</a>,
    <a href="#V2.6_Platforms">Platforms</a>,
    <a href="#V2.6_Fonts">Fonts</a>,
    <a href="#V2.6_Drivers">Drivers</a>,
    <a href="#V2.6_Interpreter">Interpreter</a>,
    <a href="#V2.6_Library">Library</a>
</ul>
<li><a href="#Version2.5.2">Version 2.5.2 (9/20/92)</a>
<ul>
<li><a href="#V2.5.2_Procedures">Procedures</a>,
    <a href="#V2.5.2_Utilities">Utilities</a>,
    <a href="#V2.5.2_Platforms">Platforms</a>,
    <a href="#V2.5.2_Drivers">Drivers</a>,
    <a href="#V2.5.2_Interpreter">Interpreter</a>,
    <a href="#V2.5.2_Library">Library</a>
</ul>
<li><a href="#Version2.5.1">Version 2.5.1 (9/11/92)</a>
<ul>
<li><a href="#V2.5.1_Procedures">Procedures</a>,
    <a href="#V2.5.1_Utilities">Utilities</a>,
    <a href="#V2.5.1_Platforms">Platforms</a>,
    <a href="#V2.5.1_Fonts">Fonts</a>,
    <a href="#V2.5.1_Drivers">Drivers</a>,
    <a href="#V2.5.1_Interpreter">Interpreter</a>,
    <a href="#V2.5.1_Library">Library</a>
</ul>
<li><a href="#Version2.5">Version 2.5 (8/18/92)</a>
<ul>
<li><a href="#V2.5_Procedures">Procedures</a>,
    <a href="#V2.5_Utilities">Utilities</a>,
    <a href="#V2.5_Platforms">Platforms</a>,
    <a href="#V2.5_Fonts">Fonts</a>,
    <a href="#V2.5_Drivers">Drivers</a>,
    <a href="#V2.5_Interpreter">Interpreter</a>,
    <a href="#V2.5_Library">Library</a>
</ul>
<li><a href="#Version2.4.2">Version 2.4.2 (5/8/92)</a>
<ul>
<li><a href="#V2.4.2_Procedures">Procedures</a>,
    <a href="#V2.4.2_Utilities">Utilities</a>,
    <a href="#V2.4.2_Platforms">Platforms</a>,
    <a href="#V2.4.2_Fonts">Fonts</a>,
    <a href="#V2.4.2_Drivers">Drivers</a>,
    <a href="#V2.4.2_Interpreter">Interpreter</a>,
    <a href="#V2.4.2_Library">Library</a>
</ul>
<li><a href="#Version2.4.1">Version 2.4.1 (4/21/92)</a>
<ul>
<li><a href="#V2.4.1_Procedures">Procedures</a>,
    <a href="#V2.4.1_Utilities">Utilities</a>,
    <a href="#V2.4.1_Drivers">Drivers</a>,
    <a href="#V2.4.1_Fonts">Fonts</a>,
    <a href="#V2.4.1_Interpreter">Interpreter</a>,
    <a href="#V2.4.1_Library">Library</a>
</ul>
<li><a href="#Version2.4">Version 2.4 (3/25/92)</a>
<ul>
<li><a href="#V2.4_Procedures">Procedures</a>,
    <a href="#V2.4_Utilities">Utilities</a>,
    <a href="#V2.4_Drivers">Drivers</a>,
    <a href="#V2.4_Fonts">Fonts</a>,
    <a href="#V2.4_Interpreter">Interpreter</a>,
    <a href="#V2.4_Library">Library</a>
</ul>
<li><a href="#Version2.3">Version 2.3 (8/28/91)</a>
<ul>
<li><a href="#V2.3_Utilities">Utilities</a>,
    <a href="#V2.3_Drivers">Drivers</a>
</ul>
<li><a href="#Version2.2">Version 2.2 (6/1/91)</a>
<ul>
<li><a href="#V2.2_Procedures">Procedures</a>,
    <a href="#V2.2_Drivers">Drivers</a>,
    <a href="#V2.2_Fonts">Fonts</a>,
    <a href="#V2.2_Utilities">Utilities</a>,
    <a href="#V2.2_Interpreter">Interpreter</a>,
    <a href="#V2.2_Library">Library</a>
</ul>
<li><a href="#Version2.1.1">Version 2.1.1 (1/15/91)</a>
<ul>
<li><a href="#V2.1.1_Build_procedures">Build procedures</a>,
    <a href="#V2.1.1_Interpreter">Interpreter</a>,
    <a href="#V2.1.1_Drivers">Drivers</a>,
    <a href="#V2.1.1_Library">Library</a>
</ul>
<li><a href="#Version2.1">Version 2.1 (12/31/90)</a>
<ul>
<li><a href="#V2.1_Build_procedures">Build procedures</a>,
    <a href="#V2.1_Drivers">Drivers</a>,
    <a href="#V2.1_Fonts">Fonts</a>,
    <a href="#V2.1_Interpreter">Interpreter</a>,
    <a href="#V2.1_Library">Library</a>
</ul>
<li><a href="#Version2.0">Version 2.0 (9/12/90)</a>
<ul>
<li><a href="#V2.0_Miscellaneous">Miscellaneous</a>,
    <a href="#V2.0_Drivers">Drivers</a>,
    <a href="#V2.0_Build_procedures">Build procedures</a>,
    <a href="#V2.0_Interpreter">Interpreter</a>,
    <a href="#V2.0_Library">Library</a>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>
This document is a history of Ghostscript releases numbered 2.n.  For more
recent changes, see the the other history documents and, for the latest
versions, the new:

<blockquote>
<a href="News.htm">News</a><br>
<a href="History4.htm">History of Ghostscript versions 4.n</a><br>
<a href="History3.htm">History of Ghostscript versions 3.n</a><br>
History of Ghostscript versions 2.n (this document)<br>
<a href="History1.htm">History of Ghostscript versions 1.n</a>
</blockquote>

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<h2><a name="Version2.9.10b"></a>Version 2.9.10-beta (7/28/94)</h2>

<p>
This is the last 2.9 beta, since 3.0 will be released on July 31.

<h3><a name="V2.9.10b_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- A | in gs.1 had a \ in front of it instead of \\.

Adds a paragraph in gs.1 that tells how to select paper size.

Notes in devs.mak that the cdj550 driver is the best one for the H-P
DeskJet 520, and the pjxl300 driver is the right one for the H-P DeskJet
1200C.

Notes in make.doc that Watcom C++ 10.0 may require a change in a makefile.

</pre><h3><a name="V2.9.10b_Procedures"></a>Procedures</h3><pre>
Removes ICCINIT from MODULES.LIS for VMS systems.

Updates VMS.MAK to support Motif V1.2.

Updates jpeg.mak to work with version 5alpha4 of the IJG JPEG code.

</pre><h3><a name="V2.9.10b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- font2c didn't leave extra room in Type 0 font dictionaries for
entries added by definefont.
	- font2c left extra information on the stack.
	- ansi2knr would remove newline characters within formal argument
lists.
	- font2c got an Error: /undefined in makefontprocname.

Updates ansi2knr to work better with the GNU configure program.

Updates ansi2knr to handle procedure formal arguments automatically.

</pre><h3><a name="V2.9.10b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- If a file contained color or gray-scale information followed by a
masked image, the X driver would sometimes invert the polarity of the
image.

</pre><h3><a name="V2.9.10b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- Unix systems with a 2-argument gettimeofday returned garbage
values for the current time.
	- The VMS build script for compiled fonts omitted the requirement
to load gs_ccfnt.ps.
	- memory_.h didn't note that System V Unix platforms need memmove.

On Unix systems, changes the subdirectory of $datadir/ghostscript to just
be the version number (e.g., 2.9.10 rather than gs-2.9.9).

</pre><h3><a name="V2.9.10b_Fonts"></a>Fonts</h3><pre>
Adds support code for the Wadalab (University of Tokyo) free Kanji font.

Notes in the documentation in Fontmap that .pfa and .pfb fonts are
compatible with ATM, but .gsf fonts are not.

Changes the names of Thomas Wolff's expanded Hershey fonts, replacing .gsf
with .pfa.

</pre><h3><a name="V2.9.10b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The scanner became confused if the literal names /&lt;&lt; or /&gt;&gt;
straddled an input buffer boundary.
	- .setlanguagelevel gave an invalidaccess error when
switching from level 2 to level 1.
	- currentgstate, setgstate, and copy for gstates didn't do
the necessary access checks.
	- The Category resource category didn't define .ResourceFile, so
/Category resourcestatus gave an error.
	- The garbage collector didn't trace the structures used by
filenameforall properly on most platforms.
	- Automatically expanding systemdict didn't work, but didn't give
an error.
	- Automatically expanding a dictionary usually expanded it by too
much.
	- systemdict was created too small.
	- The garbage collector didn't trace the structures referenced only
from allocator objects, leading to attempts to access freed storage.
	- If a chunk was empty, the GC tried to free it even if it had
inner chunks.
*	- The outer loop in dict_find_name_by_index() could cause an
addressing fault on segmented machines when looking up Level 2 operators,
because the offset could get decremented past 0.
	- The heap_available procedure in gsmemory.c didn't convert
properly to non-ANSI syntax.  (New bug in 2.9.9.)
	- The ledgertray procedure wasn't implemented.
	- The xxxtray procedures didn't set the page size.
	- The settumble operator wasn't implemented, even as a dummy.
	- glyphshow didn't work with Type 3 fonts.
	- Supplying a RenderTable for a CIE color space caused an error.
	- The DCT filter code had the jpeg/ subdirectory name "wired in" to
the source files.

Adds experimental filters for Burrows/Wheeler block sorting compression
(BWBlockSortEncode/Decode), described in DEC SRC Research Report #124,
move-to-front coding (MoveToFrontEncode/Decode), and a simple form of
Huffman coding (BoundedHuffmanEncode/Decode).  These are experimental -- do
not rely on them remaining the same (or existing at all) in future
releases!

Adds all function prototypes needed to pacify strict compilers.

Removes all explicit references to userdict from the C code.

Changes the SAFER switch so that it disallows not only explicit writing,
deleting, or renaming of files, but also disallows specifying an explicit
OutputFile for any device (except for the initial device, by means of
-sOutputFile= on the command line).

</pre><h3><a name="V2.9.10b_Streams"></a>Streams</h3><pre>
Fixes bugs:
	- Hex decoding (ASCIIHexDecode stream and &lt;&gt; literals) didn't treat
the data source as read-only (although it restored it to its original
contents).

Implements move-to-front coding, a simple form of Huffman coding, and
Burrows/Wheeler block sorting compression.

</pre><h3><a name="V2.9.10b_Library"></a>Library</h3><pre>
Fixes bugs:
*	- (The following bug fix was actually implemented somewhere around
version 2.7.)  restore didn't purge character cache entries whose keys were
names created more recently than the save.
	- gstype1.h declared gs_type1_state_sizeof as an extern, but this
wasn't defined anywhere.
	- gs_makeimagedevice didn't set the size of the palette correctly,
which confused the GC.
	- gs_makeimagedevice didn't set num_components to 1 for
mapped-color devices with only gray values.
*	- The two-color halftoning algorithms truncated when computing the
halftone level, rather than rounding it.
*	- If a path being filled had line segments that fell entirely to
the right of the clipping region, part of the path might not be filled.
	- The optimized code for 24-bit color didn't ensure properly that
32-bit accesses would be aligned appropriately.
	- The miter join check had gotten reversed somewhere along the way.
*	- Because x and y were interchanged in the miter check computation,
in some situations the check was inverted.  (This is a very old bug!)
	- It was believed that strokepath didn't work with dashed lines;
the problem appears to have been an incorrect testing program.

Adds all function prototypes needed to pacify strict compilers.

Changes fixed2float so it doesn't cast the result to float, and removes
fixed2double.  This produces slightly more accurate results in many places,
and may even be faster (for FPUs that normally generate double rather than
single precision results).

</pre>

<h2><a name="Version2.9.9b"></a>Version 2.9.9-beta (6/23/94)</h2>

<h3><a name="V2.9.9b_Documentation"></a>Documentation</h3><pre>
Puts a pointer to devs.mak in the section of use.doc that talks about
MS-DOS displays.

</pre><h3><a name="V2.9.9b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The %pipe% IODevice was omitted on System V platforms.
	- The AXP VMS build script needed /NESTED_INCLUDE=PRIMARY in
CC_QUAL to work around a bug in the DEC C compiler.

</pre><h3><a name="V2.9.9b_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
	- gs_lev2.ps redefined .loadFontmap incorrectly.

</pre><h3><a name="V2.9.9b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- stream_compact used memcpy even though the source and destination
might overlap.
	- filter applied to a closed file could cause a crash.

</pre><h3><a name="V2.9.9b_Library"></a>Library</h3><pre>
Fixes bugs:
	- putdeviceparams to a printer didn't close and reopen the device
if only the page size or resolution was changed.

</pre>

<h2><a name="Version2.9.8"></a>Version 2.9.8 (6/20/94)</h2>

<p>
This is the first version that claims to be a full Level 2
implementation.
It was distributed to satisfy a contractual requirement.
</p>

<h3><a name="V2.9.8_Documentation"></a>Documentation</h3><pre>
In make.doc:
	- Adds a reference to the generic System V section at the end of
the SCO section.
	- Notes that DEC OSF/1 systems may require changing the name of the
install program to installbsd.

Updates drivers.doc to reflect the change from "properties" to
"parameters".

Updates the Aladdin Enterprises Free Public License to version 1.

In language.doc, notes that certain device parameters will be phased out.

</pre><h3><a name="V2.9.8_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The file aa.ps was included in the distribution by mistake.

Notes in the Unix makefiles that X11R6 probably needs SM and ICE added to
XLIBS.

</pre><h3><a name="V2.9.8_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- viewjpeg.ps used a non-existent file as its example.
	- A temporary string in wrfont.ps was allocated too small.

Upgrades font2c.ps so it will handle (simple) Type 0 fonts as well as Type
1.

</pre><h3><a name="V2.9.8_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The TIFF drivers didn't byte-align each scan line.
	- gdevtfax.c applied &amp; to an array member of a structure.

Changes the param_list interface slightly: Implementations of the
put_params driver procedure should now use param_signal_error to report
errors, and should not give up at the first error.  (Even though this is a
non-backward-compatible change, old implementations will continue to work;
they just won't deliver complete results to the setpagedevice Policies
machinery.)

</pre><h3><a name="V2.9.8_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- Removes the time zone adjustment from gp_get_clock in gp_unix.c,
since the value returned by all Unix systems is bogus.
	- The DV/X makefile still included the dfaxhigh and dfaxlow drivers.
	- gssetmod.com (VMS command file) didn't work properly if the
argument list was empty.
	- vms.mak, vms-axp.mak, and modules.lis hadn't been updated to
reflect changes in 2.9.7.
	- The MS Windows version wouldn't link (overflowed the 64K primary
data segment).

</pre><h3><a name="V2.9.8_Fonts"></a>Fonts</h3><pre>
Makes the font substitution algorithm somewhat more intelligent.

</pre><h3><a name="V2.9.8_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- Enumerating the pointers of a zero-length array of structures
caused a divide by zero.
	- iref.h didn't protect itself against multiple inclusion.
	- The CCITTFaxEncode filter didn't byte-align the final
end-of-block code if EndOfBlock and EncodedByteAlign were both true.
	- make_initial_dict in iinit.c used `name' as a formal parameter
name, which some compilers believe conflicts with a typedef.
	- Not all internal operators had registered names.
	- The GC used memcpy, rather than bytes_copy, when compacting
objects, even though the source and destination might overlap.
	- When debugging was enabled, gc_string_mark could give a spurious
error indication.
	- vmstatus returned too small a value for the maximum VM.
	- The scanner could get into a loop when reading a radix-85 string.
	- The GC could get into a state where it was called after every
allocation (because of the patch setting global = true in ireclaim).
	- The general path filling algorithm didn't skip regions that were
completely outside the clipping box.
	- The gs_screen_enum structure contained a pointer (porder) that
pointed into the middle of a structure, confusing the GC.

Implements the BitmapWidths flag in fonts.  The default of false means that
we use scalable widths even with xfonts.

Changes the Generic resource category so that ResourceFileName is optional.

Changes the .getdeviceparams operator so that it takes an optional
dictionary giving the set of keys whose values are wanted.  Changes the
.putdeviceparams operator so that it takes an optional policy dictionary
specifying the action to be taken on errors, and returns a list of keys and
errors if it fails, rather than causing an error.  These are
non-backward-compatible changes, but ordinary programs do not use these
operators.

Changes the names of some internal operators and procedures by adding
a . to the beginning:
	currenttime
	devicename

Implements currentpagedevice, and a small subset of setpagedevice.  Only
the following keys in the page device dictionary are known to the current
implementation, and the ones marked with * are not actually processed:
	PageSize
	InputAttributes
	MediaColor, MediaWeight, MediaType, InsertSheet
	  (for InputAttributes matching only)
	*ImagingBBox
	OutputAttributes
	OutputType
	  (for OutputAttributes matching only)
	NumCopies
	HWResolution
	*Margins
	*Orientation (for all devices, not just roll devices)
	Policies
	Install
	BeginPage
	EndPage
Does not implement:
	- Updating InputAttributes or OutputAttributes by sensing the state
	  of the device;
	- Retrying media matching after an initial failure;
	- Automatic handling of portrait vs. landscape page size;
	- Recording the CTM after Install as the one to be used for
	  defaultmatrix, initmatrix, and initgraphics.
Also, media matching is normally disabled (with InputAttributes = null)
for all devices.  ****** We had to disable setpagedevice just before
shipping this release, because of interactions with the older device
handling machinery that we could not fix in the time available.

</pre><h3><a name="V2.9.8_Library"></a>Library</h3><pre>
Fixes bugs:
	- 24-bit color (mem_true24_fill_rectangle and _copy_mono) had
algorithm bugs.
	- A complex conditional expression in gx_render_gray wouldn't
compile properly with the DECStation 3100 Ultrix 4.3 compiler.
	- The GC routines for gx_device_clip didn't handle the case where
the 'current' pointer pointed to list.single.
	- gx_add_char_bits used memcpy, rather than bytes_copy, for
compressing character bitmaps, even though the source and destination might
overlap.
	- Some compilers require the definition of st_gstate_contents to
precede the definitions of the GC procedures.
	- Filling a large rectangle (more than 1K of bitmap) with a colored
halftone overwrote random areas of the stack.

Changes gs_setcachedevice[2] to take a pointer to an array of floats,
rather than 6 or 10 individual floats.  THIS IS A NON-BACKWARD-COMPATIBLE
CHANGE.

Implements the BitmapWidths flag in fonts.

</pre>

<h2><a name="Version2.9.7b"></a>Version 2.9.7-beta (6/5/94)</h2>

<p>
Yet another pre-3.0 beta.  The main features are a fairly reliable
garbage
collector, and function prototypes almost everywhere they are needed.

<h3><a name="V2.9.7b_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The comment at the beginning of the zfindlibfile procedure was
incorrect.

Replaces the GNU License (the COPYING file) with version 0 of the new
Aladdin Enterprises Free Public License (the PUBLIC file).

</pre><h3><a name="V2.9.7b_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The definition of cmykread.dev in gs.mak was incorrect (it
modified color.dev).

Adds the ability to specify a value for FONTPATH on the command line
(-sFONTPATH=), overriding GS_FONTPATH.

Replaces the -oper2 configuration resource type with the ability to specify
in the op_def list the dictionary in which operators will be defined.  (See
opdef.h for more details.)  This is an internal change only.

</pre><h3><a name="V2.9.7b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- viewgif.ps got an error on interlaced GIF files whose height
wasn't a multiple of 8.

Changes traceop.ps so it stores the traced operator in the same dictionary
where the operator is currently defined, if possible.

</pre><h3><a name="V2.9.7b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The new G3 fax drivers crashed on page widths greater than 2623
(40 * 64 + 63) pixels.  (We fixed this by disallowing page widths greater
than approximately twice this.)
	- The 24-bit PCX driver had some debugging code accidentally left
in it that produced large volumes of useless console output.

Removes the previous (Leffler) TIFF/F driver and the TruFax driver.

</pre><h3><a name="V2.9.7b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- time_.h, gp_unix.c, and gp_sysv.c didn't do the right thing on
SVR4 platforms, where gettimeofday only takes 1 argument.
	- The final linking command on Turbo C platforms didn't specify the
COMPDIR directory for the linker.

</pre><h3><a name="V2.9.7b_Fonts"></a>Fonts</h3><pre>

Changes the standard Fontmap to use the URW contributed fonts as
work-alikes for Helvetica and Times Roman.

</pre><h3><a name="V2.9.7b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The garbage collector wasn't in a consistent state.
	- In Level 2 mode, statusdict was allocated in global VM rather
than local VM.
	- resourceforall gave an error on the built-in categories such as
Filter.
	- The file searching algorithm didn't check the current directory
first.
	- When opening a file failed, it didn't return a different error
depending on the problem.
	- The CCITTFaxEncode filter crashed on widths larger than 2623 (64
* 40 + 63) pixels.  (We fixed this by disallowing page widths greater than
approximately twice this.)
	- The .type1getsbw operator gave an invalidfont error if a
CharString started with anything other than a [h]sbw.  (Adobe's published
specs say this is invalid, but some Adobe MultiMaster fonts start with a
callsubr and/or a callothersubr.)
	- When printing out the stack with == after an error, the error
handler got a repeated (and ultimately fatal) typecheck error if it
encountered an object of non-standard type.
	- The token operator could incorrectly attempt to free a structure
on the stack if it encountered an input buffer boundary.
	- string_to_ref didn't correctly set the a_local flag in the string
object it created.
	- If the -c switch was the last switch on the command line,
Ghostscript always exited without going into interactive mode.
	- copy didn't check for errors when copying a dictionary.

Makes many minor changes (mostly adding prototypes) to reduce error and
warning messages from gcc and other strict compilers.

Adds files containing the 4 predefined PDF encodings (MacRoman, MacExpert,
WinAnsi, and PDFDoc).

</pre><h3><a name="V2.9.7b_Library"></a>Library</h3><pre>
Fixes bugs:
	- image_bbox in gxccman.c could produce a division by 0 if a
0-width character was being entered into the cache.
	- gx_image_cached_char incorrectly specified a scale of 2x2 rather
than 1x1 if it had to read bits from an xfont.
	- Stale pointers in the halftone cache weren't cleared properly by
a restore.  (We fixed this by making grestoreall clear the halftone cache.)
	- setdash used gs_malloc, rather than the current allocator, for
allocating the dash pattern.
	- If one attempted to fill a very wide region with a colored
halftone, gx_dc_ht_colored_fill_rectangle would loop indefinitely.
	- The container_offset in clipping devices was set incorrectly,
causing the garbage collector to mangle pointers.

Changes the fopen routine in IODevices so that it can return an arbitrary
error code, rather than simply succeeding or failing.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE.  It only affects IODevice implementations,
of which there are very few.  (It doesn't affect ordinary device drivers.)

Changes the char_metrics xfont procedure so it returns the width as
floating point numbers rather than integers.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE.  It only affects xfont implementations, of
which there are very few.

Makes many minor changes (mostly adding prototypes) to reduce error and
warning messages from gcc and other strict compilers.

</pre>

<h2><a name="Version2.9.6b"></a>Version 2.9.6-beta (5/23/94, not
distributed to the public)</h2>

<p>
This, too, was supposed to be the last beta release for public
release 3.0.
It was created primarily for a user who desperately needed a Level 1 system
that would run properly on a 64-bit hardware architecture.  The garbage
collector is badly broken (it's in the middle of an architectural change);
setpagedevice is still not implemented.

<h3><a name="V2.9.6b_Documentation"></a>Documentation</h3>

<pre>
Documents the standard location of Type 1 fonts on AIX.

Changes the last few mentions of Ghostview for Microsoft Windows to GSview
for Windows.

Notes that Solaris 2.n provides the X11 header files in a different place.

Changes README to reflect the differentiation between Aladdin Ghostscript
and GNU Ghostscript.

</pre>
<h3><a name="V2.9.6b_Procedures"></a>Procedures</h3>

<pre>
Fixes bugs:
	- The compilation rules for the modules that call the IJG library
used -Ijpeg rather than -I$(JPEGSRC).
	- The rule for gslib.dev omitted echogs$(XE) as a prerequisite.

Makes it possible to define the values of buildtime, copyright, revision,
revisiondate, and serialnumber in the makefile.

</pre><h3><a name="V2.9.6b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- The viewgif.ps utility didn't handle local color tables.

Updates ps2ai.ps to version 1.81.

</pre><h3><a name="V2.9.6b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The TIFF and fax devices used some identical names, causing
linker complaints.
	- The bj10e/bj200 driver inadvertently disabled the sheet feeder.
(The change may not actually fix this bug, since we don't have either of
these printers with a sheet feeder to test it on.)
	- The 'bit' device didn't map colors to pixel values correctly.
	- The monochrome PCL driver didn't work around the fact that the
Canon LBP4i printer didn't clear its seed row correctly.

Adds new drivers:
	- A user-contributed driver for the H-P DesignJet 650C.
	- A user-contributed driver for the Canon LIPS III printer.
	- A completely new tiffg3 driver with one based on the new, fast
faxg3 code.  This driver does not include any external code, and carries an
Aladdin copyright.
	- A tiffg4 driver, also based on the fast CCITT filter code.

Removes the tiffg3x driver that appeared briefly in 2.9.5, and renames the
previous (Leffler) tiffg3 driver as tiffg3x.

Adds support for A0, A1, and A2 paper sizes to PCL drivers.

Changes all the names involving "props" to "params", for consistency with
the header files, some other internal interfaces, and Adobe's terminology.
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.  However, it only affects devices
that implement their own get_props and put_props procedures, of which there
aren't very many.

</pre><h3><a name="V2.9.6b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The DV/X makefile used X11 rather than X for the X11 library name.
	- The DV/X makefile incorrectly included the PC display drivers.
	- The DV/X makefile omitted gp_dosfs.$(OBJ) from the list of
platform-specific files.
	- The DV/X makefile used : rather than ; for separating directory
names in GS_LIB_DEFAULT.
	- x_.h omitted a needed alias for XtAppSetFallbackResources.
	- The makefile entry for System V Unix systems didn't include
gp_unifn.$(OBJ).
	- The comment before LDFLAGS in the gcc makefiles incorrectly
suggested using the -x switch on Ultrix platforms.
	- The forward declaration of quant_params in zfdct.c upset the Sun
compiler because it declared a parameter as float rather than floatp.
*	- The Microsoft C compiler, like the Borland C compilers, only
compares the offset part of segmented pointers.

</pre><h3><a name="V2.9.6b_Fonts"></a>Fonts</h3><pre>

Adds a fontmap suitable for use with Adobe Type Basics.

</pre><h3><a name="V2.9.6b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The STACK_LOOP_BEGIN macro in istack.h didn't work correctly on
segmented systems.
	- The end_phase procedure in igc.c didn't work correctly on
segmented systems.
	- Indexed color spaces didn't mark their base space properly when
garbage collecting.
	- The garbage collector didn't work on segmented systems, because
it smashed the lsize field of large objects with mark/reloc information.
	- Some structures didn't have correct associated GC procedures:
gs_indexed_map, gs_client_pattern, gs_pattern_instance.
	- restore could free names or stack segments that were still
referenced.
*	- If a packed object caused an error, the error object could be set
to garbage rather than the correct object.
*	- Badly designed error handlers which use $error for temporary
storage could cause a dictfull error.
	- Some compilers objected to the use of "dict" as a variable name
in a scope where it was defined as a type.
	- IODevices were declared const and non-const inconsistently.
	- setpagedevice popped one object too many off the stack if the
request included any subdictionaries that needed to be merged.
	- More garbage collector bugs were fixed.
	- If the current stack block was empty, Level 2 restore would give
a spurious typecheck error.
	- The CCITTFaxEncode filter could get confused if it emptied the
input and filled the output at the same time.
	- The CCITTFaxEncode filter could insert an extra EOL if it had to
suspend at certain times.
	- The new parser for literal strings (as of 2.9.5) could mis-count
internal parentheses if a parenthesis caused the internal buffer collecting
the string to overflow.
	- If the current stack block had fewer than 3 elements,
.type1addpath could report a spurious typecheck error.
	- Text rendering operations (show, stringwidth, etc.) caused a
crash if the current color was a Pattern that hadn't already been
rasterized.
	- If a program did a grestore when the graphics state stack was
empty, the graphics state was initialized to unexpected (and, in some
cases, invalid) values.
	- pathforall could cause a bogus stackoverflow if it overflowed the
current stack block.
	- Closing an encoding filter with a procedure as target left the
filter on the stack.
*	- The outer loop in dict_lookup() could cause an addressing fault
on segmented machines when looking up Level 2 operators, because the offset
could get decremented past 0.
	- There was an = instead of an == in a test in scanner_reloc_ptrs.
	- The call on gs_reloc_refs in sproc_reloc_ptrs in zfproc.c omitted
the last (gcst) argument.

(Re-)implements the 2-D case of CCITTFaxEncode, and fixes a couple of bugs
in it.

Adds DiffEncode and DiffDecode filters that implement color prediction for
the PDF variant of the LZWDecode filter.

Changes the specification of .oserrorstring to be similar to getenv,
where, etc.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE; however, no
user-written code should be using .oserrorstring.

Adds oversampling for better character rasterizing.

</pre><h3><a name="V2.9.6b_Library"></a>Library</h3><pre>
Fixes bugs:
	- gx_dc_ht_colored_fill_rectangle gave a compiler warning because
of a problem with const pointers.
	- dfmul2fixed_vars (in gxfixed.h) omitted the &amp; before vda on
big-endian platforms, causing compilation errors.
	- IODevices were declared const and non-const inconsistently.
	- The Type 1 rasterizer never enabled overshoot suppression.
	- stroke didn't fatten the line properly if stroke adjustment was
enabled, or if the line was horizontal or vertical.
*	- The clipping test for characters was too strict by almost 1
pixel, leading to unnecessary clipping of text at the edge of the clipping
box.
*	- The initial clipping box was computed incorrectly for devices
whose initial transformation matrix included a rotation.

Changed the implementation of clipping lists and show enumerators to use
separate objects rather than embedded objects, to pacify the GC.  (This is
an internal change, not visible at the PostScript or API level.)

Makes the character cache trim off left and right blank areas, as well as
top and bottom.  (Internal change.)

Adds oversampling for better character rasterizing.

</pre>

<h2><a name="Version2.9.5b"></a>Version 2.9.5-beta (4/11/94)</h2>

<p>
This was supposed to be the last beta release before 3.0, but it
won't be.
The only known major defects are the unreliable garbage collector, and the
dummy implementation of setpagedevice/currentpagedevice.

<h3><a name="V2.9.5b_Documentation"></a>Documentation</h3>

<pre>
Fixes bugs:
	- The file commnew.doc didn't belong in the fileset.

Notes in the makefiles that SVR4 systems may need to set EXTRALIBS=-lnsl.

Adds a user-contributed `man' page for the ps2epsi utility.

</pre><h3><a name="V2.9.5b_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The IJG files didn't compile properly by themselves, because they
didn't have $(AK) in their dependency list.

Changes back the handling of files named on the command line, so that they
are first sought in the current directory, and if that fails, use the
search path.  (2.9.4-beta changed things so that files on the command line
did not use the search path, because as of that version, the search path
doesn't necessarily include the current directory.  I consider the "check
the current directory and then use the search path" rule, which is the
MS-DOS standard and was used in Ghostscript prior to 2.9.4, a serious
mistake, since it is one of the best-known security holes in Unix and can
also produce confusing and unexpected results depending on the current
directory; I would much rather have a clear distinction between
user-specified files, which should not use any path searching, and system
files, that only use the defined search path.  However, as of this moment,
users seem to want the convenience at the expense of insecurity and
confusion.)

Adds '.' to the beginning of the search path for MS-DOS platforms, to
conform to the usual MS-DOS file searching convention.

Adds a -c ("code") switch, which interprets following arguments (until the
next switch) as PostScript tokens.

Changes the handling of FEATURE_DEVS so that either level1.dev or
level2.dev must normally be selected.  THIS IS A NON-BACKWARD-COMPATIBLE
CHANGE for Level 1 systems, which formerly set FEATURE_DEVS to an empty
definition.

</pre><h3><a name="V2.9.5b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- bench.ps didn't switch back to local VM properly before running
the program being benchmarked.

Adds a ppmsetpagesize command to the pstoppm utility.

</pre><h3><a name="V2.9.5b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The PCX and GIF drivers used an incorrect algorithm for computing
the blue component of the color palette, which could cause colors to come
out with not quite enough blue.
	- The SPARCprinter driver wouldn't compile with non-ANSI compilers.

Adds new drivers:
	- A user-contributed driver for DEC sixel displays like the VT240
(sxlcrt, in gdevln03.c, which has a FSF copyright.)
	- A much larger and supposedly faster version of the TIFF/F driver
(tiffg3x, in gdevtifx.c), contributed by a user.  This has the same
copyright as the TIFF/F driver (gdevtiff.c).
	- A driver (faxg3, in gdevfax.c) that produces plain Group 3 fax
output with no header, using the CCITTFaxEncode filter to do the work.
(This is around 2.5-3 times as fast as the other fax drivers distributed
with Ghostscript.)
	- A user-contributed driver for the Mitsubishi CP50 color printer.

Changes the `bit' driver so one can set the Colors and *Values properties.

Makes the color mapping for PC displays, PCX files, and GIF files identical
(they differed slightly before).

</pre><h3><a name="V2.9.5b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- VMS used DISPLAY rather than DECW$DISPLAY to get the display name
if opening the display failed.
	- Many minor bugs relating to OS/2 and Win32 were fixed.
	- On Unix and DV/X platforms, the install script didn't mkdir
$(gsdir), and didn't mkdir the intermediate directory for the man page.
	- On BSD and UTek platforms, the declaration of memset in
memory_.h, and the definition in gsmisc.c, conflicted with the ANSI
declaration.
	- One of the SPARC compilers compiled the intersection computation
in arc_either (gspath.c) incorrectly.
	- The temporary file names created under OS/2 could exceed the 8.3
length limit.

</pre><h3><a name="V2.9.5b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The test files for the IJG library had been damaged by EOL
conversion.
	- The garbage collector didn't mark some of the most recently
created names.
	- The interpreter would sometimes report a typecheck instead of a
stackunderflow.
	- If aload didn't have enough room on the stack, it would report a
rangecheck rather than a stackoverflow.
	- zcontext wouldn't compile, because it hadn't been updated to the
new GC interfaces.
	- The definition of private_st_stream_proc_state in ifilter.h ended
with a semicolon, which upset some compilers.
	- load didn't check to make sure that the dictionaries it examined
had read access.
	- cvrs didn't handle negative numbers in radix 2 or 3 properly.
	- The allocator could become confused if it was asked to allocate a
large array.
	- readline gave an ioerror rather than a rangecheck if it
overflowed the string.
	- The allocator didn't free packed arrays properly.
	- The allocator's check for LIFO freeing of arrays was off by 1, so
it never succeeded.
	- The undercolor removal and black generation procedures weren't
initialized properly.
	- If the interpreter couldn't find gs_init.ps, it returned a random
exit code.
	- If an operator expected a procedure and didn't get one, it
sometimes gave an invalidaccess rather than a typecheck.
	- Unix file enumeration often did the wrong thing if there were
directories in the pattern.
	- The ASCIIHexDecode filter read an extra character after the
terminating &gt;.
	- scalefont didn't fill in ScaleMatrix properly.
	- The CCITTFaxEncode filter crashed if the width of the page wasn't
a multiple of 8 bits.
	- The error printing code used .languagelevel, which wasn't defined
in Level 1 configurations.
	- setpagedevice didn't pop its argument.
	- Definitions in statusdict didn't change according to the current
language level.
	- Separation color spaces didn't allow strings as color space names.
	- Due to a bug in chunk_locate_ptr, the garbage collector sometimes
decided incorrectly that a pointer was pointing outside collectable space.
	- (Many other garbage collector bugs were fixed.)

Implements additional Level 2 features:
	- Garbage collection for strings.
	- Expandable operand and dictionary stacks, and the ability to set
	the maximum size of these stacks.
	- Additional user and system parameters.  The following are dummies:
	AccurateScreens, JobName, JobTimeout, WaitTimeout.
	- Procedure-based filters usable with cvx/exec and token.
	- Separation color spaces (always using the alternate space).
	(These were theoretically implemented in version 2.6, but they were
	never tested and were actually missing most of the implementation.)
	- VMThreshold and VMReclaim for invoking GC automatically.

Adds a hook in iscan.c for parsing DSC comments.

Adds encoding and decoding filters for the BCP and TBCP protocols.  These
are not fully implemented yet:
	- The interrupt and status request characters are ignored on input,
	and never generated on output;
	- The TBCP encoder doesn't emit the start-of-protocol string;
	- The TBCP decoder doesn't recognize the end-of-protocol string.

Factors out Type 1 font capability as a separate feature.

Changes the names of some files:
	packed.h to ipacked.h;
	bnum.h to ibnum.h.

Changes the name of the value.index member of a ref to value.boolval.
(Internal change only.)

</pre><h3><a name="V2.9.5b_Library"></a>Library</h3><pre>
Fixes bugs:
	- The definition of RELOC_PTRS_BEGIN in gsstruct.h wouldn't compile
properly with non-ANSI compilers.
	- The JPEG library wouldn't compile properly with non-ANSI compilers.
*	- The platform font machinery gave up too easily in some cases.
	- CMYK devices needing halftoning converted the CMYK color to RGB.
	- The debugging code in arc_add (gspath.c) didn't print the output
values correctly.

Factors out Type 1 font capability as a separate feature.

</pre>

<h2><a name="Version2.9.4b"></a>Version 2.9.4-beta (2/19/94)</h2>

<h3><a name="V2.9.4b_Procedures"></a>Procedures</h3>

<pre>
Changes Ghostscript's path searching algorithm so that it does not
automatically look in the current directory first.  (The former algorithm
was more MS-DOS-like; the new one is more Unix-like.)  If you want to
include the current directory, you must include '.' in the search path.
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.

Adds two new resource types for genconf.c:
	- -header filexxx.h adds #include "filexxx.h" to gconfig.h.
	- -libpath dir adds dir to the list of library search paths.

</pre><h3><a name="V2.9.4b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- impath.ps (used by bdftops) computed the starting X coordinate
incorrectly, typically causing characters to be displaced slightly to the
right.
	- pstoppm.ps didn't handle local and global VM properly.

Adds a ps2ai.ps utility, contributed by a user, for converting arbitrary
PostScript files into a form compatible with Adobe Illustrator.

</pre><h3><a name="V2.9.4b_Drivers"></a>Drivers</h3><pre>

Adds new drivers:
	- A user-contributed driver for Imagen Impress laser printers.
	- A user-contributed driver for the DEC LA75plus printer.

</pre><h3><a name="V2.9.4b_Platforms"></a>Platforms</h3><pre>

Under OS/2, adds the ability to keep Ghostscript in memory for a
specified number of minutes.

Adds support for Win32 and Win32s.

Changes the MS Windows platform font interface so that it does not attempt
to render fonts at sizes smaller than 6 pixels.  Changes the X Windows
interface, which already did this for 4-point and smaller fonts, to also
use a lower limit of 6 pixels.  Also changes the X Windows platform font
machinery so it does not render fonts at sizes larger than 36 pixels: at
large sizes, Ghostscript does a perfectly good job, and some X font servers
rasterize the entire font and lock up the entire window system while doing
so.

</pre><h3><a name="V2.9.4b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- currentdash always returned a new array of reals, rather than the
actual argument of setdash.
	- Strings in binary object sequences read in as integers.
	- Because of a bug in chunk_locate_ptr, some large objects didn't
get freed properly.
	- If an error occurred while processing an image, Ghostscript would
attempt to free random blocks of storage.
	- Input filters discarded trailing data, rather than filling it out
with zeros.  (This is now fixed for ASCIIHexDecode and ASCII85Decode; it's
not clear what other filters it should affect.)
	- The ASCII85Encode filter produced garbage output for the final
1-4 bytes before EOD.
*	- The TIFF output driver produced incorrect output for the second
and subsequent pages if the output was being produced on multiple files.
*	- The default handleerror did a 'stop', which was not correct.
	- gpcheck.h converted all positive return codes to 0 if interrupt
checking was enabled.
	- Images with multiple data sources didn't work.
	- Images with 12-bit sample values didn't work.
	- Images with a file as the data source read additional data beyond
what was required.
	- 2 vmreclaim worked (pretty much), but 1 vmreclaim didn't.
	- If %lineedit was opened multiple times, characters from later
openings overwrote characters from earlier ones.
	- token returned garbage for the "remaining string" result when
reading from a string, if it actually read all of the string.  (New bug in
2.9.2, probably.)

Implements additional Level 2 features:
	- DCTEncode and DCTDecode filters.
	- Filters with procedures as the data source or target.
	(Except for token and cvx/exec.)
	- Garbage collection for names.

Changes the error printout so that strings are always truncated at 200
characters.

For Level 2 systems, changes the initial setting of the object format
parameter from 0 to an appropriate non-zero value.

* Changes the .quit operator so that it takes two operands, an error object
and an error code; if the latter is negative, the interpreter returns this
as the error code, rather than e_Quit.

Makes StandardEncoding and ISOLatin1Encoding arrays, rather than packed
arrays, on large-memory systems, for compatibility with certain test
suites.  Changes .registerencoding to accept arrays as well as packed
arrays.

</pre><h3><a name="V2.9.4b_Library"></a>Library</h3><pre>
Fixes bugs:
	- Due to an error in cie_mult3, CIE-based colors were badly
mis-mapped.
*	- Very narrow (but not empty) rectangles would disappear.
*	- Small halftone cells could smash the next higher entry in the
halftone cache.
	- The orientation algorithm in gxstroke.c still interchanged
clockwise and counter-clockwise coordinate systems (after having been
"fixed" at least 3 times).
	- Stroking 1-pixel-wide lines shortened them, instead of
lengthening them, if non-butt caps were requested.

Refactors mem_mapped8_copy_mono because of limitations in the bcc32
compiler.

</pre>

<h2><a name="Version2.9.3b"></a>Version 2.9.3-beta (1/19/94)</h2>

<p>This version was created for evaluation purposes for a few users who
needed Level 2 capability; it was never released to anyone else, even
beta testers.

<h3><a name="V2.9.3b_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The description of psview and xpsview was incorrect.

</pre><h3><a name="V2.9.3b_Procedures"></a>Procedures</h3><pre>
Changes the installation directories for Unix and similar systems to put
Ghostscript data in $(datadir)/ghostscript/gs-NN.NN.NN rather than directly
in $(datadir)/ghostscript.  (Fonts still go in $(datadir)/ghostscript/fonts.)

</pre><h3><a name="V2.9.3b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- Some spaces were incorrectly replaced with tabs in the help
message in the 3B1 display driver.
	- The BMP driver wrote a spurious scan line at the beginning
of its output.
	- The monochrome PCX driver had the two palette elements
interchanged.

Adds new drivers:
	- A user-contributed driver for the Xerox XES printer format.  This
has a FSF copyright.
	- A user-contributed driver for the Epson AP3250 printer.  (This is
the same as the Stylus 800, with slightly different margins.)
	- A user-contributed driver for the DEC LA70 printer with some
algorithms for improving text at low resolutions.  This has a FSF
copyright.
	- A user-contributed driver for an intermediate-resolution mode
for 9-pin "Epson-compatible" printers.

Changes the name of the Stylus 800 driver from escp2 to st800.

Adds a compile-time flag to the Epson driver to cope with Panasonic 9-pin
printers, which sometimes have trouble mixing graphics and tabs.

</pre><h3><a name="V2.9.3b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The MS Windows driver (gp_mswin.c) referred to iodev.h rather
than gxiodev.h.
	- On Unix System V platforms, gp_unifs.c and gdevpipe.c were
incorrectly omitted from the link list.
	- (Some?) System V platforms don't have the S_ISDIR macro,
requiring a change in stat_.h.
	- The Unix `install' target didn't install gs_std_e.ps and
gs_iso_e.ps.
	- No MODULES.LIS file was provided for VMS.

Adds Desqview/X makefiles that actually work.

Documents the set of H-P-supplied patches needed to make H-P's
compilers process Ghostscript.

Changes the MS Windows driver so that if the user presses the Enter key
while the image window has the focus, the text window will be brought to
the top and made the active window.  This is useful when viewing a
multi-page document with Ghostscript.

</pre>
<h3><a name="V2.9.3b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The definition of public_st_client_color() in gxccolor.h
included an extraneous semicolon.
	- The definition of private_st_AXD_state() in sfilter.h included an
extraneous semicolon.
	- saxx.c didn't include sfilter.h, which it needed for the
definition of private_st_AXD_state().
	- ialloc_struct failed to create a separate chunk if the structure
was very large.
	- setcolorspace didn't allocate the colorspace object in the same
VM space as the graphics state, causing problems when the colorspace was
freed.
	- In rare circumstances, currentfile could return an empty array
rather than a file.
	- Dictionary keys were always allocated in global VM.
	- If NOPLATFONTS was true, definefont didn't check whether the
dictionary was read-only before trying to insert an ExactSize key.
	- startjob could get an invalidaccess error, because serverdict was
allocated in global VM.
	- Using definefont with an already registered font created a
circular list structure.
	- If a PostScript procedure appeared as a CharString in a Type 1
font, it was always called with the character name, never the character
code.
	- The SubFileDecode filter didn't work with a non-empty EOD string
(went into an endless loop).  (Probably a new bug in 2.8.)
	- save/restore didn't properly restore the maxlength of a
dictionary, causing data to get smashed at random.  (New bug in 2.9.)
	- save didn't mark objects as old, so a nested restore had no
effect.  (New bug in 2.9.2.)
	- After returning from an OtherSubrs callback, op_type1_free
freed the saved interpreter state incorrectly.  (New bug in 2.7.)
	- Level 1 configurations didn't work because .makeoperator gave an
invalidaccess error.  (New bug in 2.9.2.)
	- ASCII85 string literals didn't work.  (Probably a new bug in 2.8.)
	- If the current global/local allocation mode was different at the
end of a file than at the beginning, an addressing fault could occur
(gs_unregister_root in gs_run_string).  (New bug in 2.9.2.)
	- After a setfileposition on a file open for reading,
fileposition would return an incorrect value, even though the stream
was actually repositioned properly.

Brings the dictionary unpacking code for the DCT filters into line with
Adobe Technical Note 5116, which describes the Picky parameter for
DCTDecode and the NoMarker, Resync, Blend, Picky, and Relax parameters for
DCTEncode.

Changes the .quit operator so that if given a negative argument, the
interpreter returns this as the error code, rather than e_Quit.

Changes the Ghostscript integer version number from 100P+10S+T to
10000P+100S+T.

Changes the default halftone screen for high-resolution devices, both
black-and-white and color.

</pre><h3><a name="V2.9.3b_Library"></a>Library</h3><pre>
Fixes bugs:
	- The software floating multiply code used with USE_FPU=-1 only
worked on little-endian platforms.
	- Specifying a left side bearing to .type1addpath produced an
inappropriate offset.

</pre>

<h2><a name="Version2.9.2b"></a>Version 2.9.2-beta (1/2/94)</h2>

<p>This version was distributed only to beta testers.  It adds a garbage
collector and full local and global VM support.  It is the first version
that sets languagelevel = 2, i.e., claims to be a Level 2 implementation.

<h3><a name="V2.9.2b_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- make.doc still referred to use_* variables in gdevx.c, and
use.doc didn't explain the use* X resources.

Notes that -Olimit=1000 is needed to compile Ghostscript on AXP systems
under OSF/1 1.3.

</pre>

<h3><a name="V2.9.2b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- viewgif.ps did not work with interlaced images.
	- font2c.ps omitted gsmemory.h from the #include list in compiled
fonts.

</pre><h3><a name="V2.9.2b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The MS Windows driver hadn't been updated to work with the
new additions to the gx_device structure.
	- The BMP file driver wrote one scan line too many.
	- The cdj driver omitted an important cast to int in the error
diffusion code (FSdither macro).

Changes the SuperVGA drivers to recognize erasepage and reset the
color table, like the X driver.

Adds some fragmentary code to begin implementing the PostScript fax
extensions.

</pre><h3><a name="V2.9.2b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The procedure initializers for the MS Windows console I/O
were missing the new reset element.
	- The makefile entry in bcwin.mak used -fdev rather than -iodev.
	- The Borland C++ makefiles exceeded MS-DOS's line length limit if
the compiler files were in the standard Borland directory (BORLANDC).
	- Some procedures weren't declared with prototypes in gp_vms.c.
	- Some declarations had to be reordered to pacify the VAX compiler.
	- Under MS Windows, Ghostscript didn't automatically de-iconify the
text window to display messages on an error exit.
	- The Unix makefile rule for gconfig_.h used echogs rather than
./echogs.
	- The Microsoft C makefile referred to an obsolete file gs.tr.
	- gp_unifs.c used strpbrk and strrchr, which some systems lack.

Updates the OS/2 code and documentation for compatibility with the current
Ghostscript version.

</pre><h3><a name="V2.9.2b_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
	- The X11 .pfa fonts replaced their .gsf requirements in the
fontmap, but not distributed with the previous (beta) release.

Adds fontmaps appropriate for use with DEC Ultrix and OSF/1 systems.

</pre><h3><a name="V2.9.2b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- 4-value entries in the Metrics dictionary were interpreted with
the width and side bearing interchanged.
	- Objects large enough to require their own chunk were not freed
properly.
	- The GS_FONTPATH scanner didn't deal with the possibility that
opening a file might fail.
	- The interrupt and timeout errors incorrectly pushed an error
object on the operand stack.
	- imagemask gave an error if it was invoked with a dictionary
argument with a current color space with more than 1 parameter.
	- definefont insisted that a new font not have a FID entry.
	- Some places didn't cast char to byte when needed.
	- An extra element was left on the stack when substituting the
default font for a font whose file couldn't be found.
	- The CCITTFaxDecode filter didn't allow the dictionary to be
omitted.  (The Adobe documentation doesn't allow this, but Adobe
implementations do.)
	- When the input came from a pipe (`-') switch, opening a filter on
currentfile that required more than 1 input byte to make progress would
cause Ghostscript to hang (in sreadbuf).
	- The interpreter didn't call gs_set_lib_paths before executing a
compiled-in initialization file.
	- A stream could be closed more than once.  (New bug in 2.8.)
	- The LZW decoder produced incorrect output if a code string was
too long to fit into a single output buffer.  (New bug as of 2.8.)

Implements a special check in def to allow construction of systemdict,
which is stored in global VM but references dictionaries in local VM.

Implements additional Level 2 features:
	- %null% and %ram% IODevices.
	- startjob, exitserver.
	- Local and global VM (finish).
	- Garbage collection (for everything except names and strings).

Moves the procedures for selecting paper size from systemdict to userdict.

Sets languagelevel to 2 in Level 2 mode, since essentially all of
Level 2 is now implemented.

Factors out the Level 1 extended color facilities (CMYK color and
colorimage) as a separate configuration feature.

Adds some preliminary code to begin implementing the Adobe BCP and TBCP
communication protocols.

Changes the implementation of save and restore so that the bookkeeping
structures are allocated in the new area, not the old.  (This is an
internal change not visible at the PostScript level.)

</pre><h3><a name="V2.9.2b_Library"></a>Library</h3><pre>
Fixes bugs:
	- gdevprn used some preprocessor macros in formal argument
lists that ansi2knr couldn't handle.
	- pick_cell_size called gs_distance_transform with a 0 argument
that non-ANSI compilers didn't automatically promote to floating point.
	- gs_screen_init called hypot with integer arguments that
non-ANSI compilers didn't automatically promote to floating point.
	- Some places didn't cast char to byte when needed.
	- The vx/vy origin adjustment for WMode=1 wasn't implemented.
	- The pattern cache wasn't initialized properly.
	- Composite fonts didn't properly decode strings that started with
an escape sequence, which have a special (undocumented) decoding rule, and
also didn't properly decode strings with multiple consecutive escape
sequences.

Factors out the Level 1 extended color facilities (CMYK color and
colorimage) as a separate configuration feature.

</pre>

<h2><a name="Version2.9.1b"></a>Version 2.9.1-beta (12/7/93)</h2>

<p>This version was distributed only to beta testers.

<h3><a name="V2.9.1b_Utilities"></a>Utilities</h3><pre>
Adds a viewgif.ps utility to view GIF files.  The current version does not
work with interlaced data, local color tables, or files containing more
than one image.

</pre><h3><a name="V2.9.1b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- putinterval and copy didn't do the right thing if the source and
destination were aliases for overlapping sections of the same array or
string.
	- The DCT filter stub didn't allow the dictionary to be omitted.
(The Adobe documentation doesn't allow this, but Adobe implementations
do.)

Adds an optional dictionary argument to the LZWDecode filter, containing
InitialCodeLength, FirstBitLowOrder, BlockData, and EarlyChange entries.
Setting these parameters appropriately allows reading (non-interlaced) GIF
data directly.

</pre><h3><a name="V2.9.1b_Library"></a>Library</h3><pre>
Fixes bugs:
	- setdash produced inverted output if the pattern had an odd
number of elements and the offset O had the property that L &lt;= O mod
2*L, where L was the sum of the pattern elements.

</pre>

<h2><a name="Version2.9b"></a>Version 2.9-beta (12/6/93)</h2>

<p>Like 2.7, this version was created to satisfy a contractual
requirement,
and will never be distributed to anyone other than the other party to the
contract.

<h3><a name="V2.9b_Documentation"></a>Documentation</h3><pre>
Notes that Ghostscript runs on IBM PCs and compatibles under DR DOS
6.0.

Notes that Ghostscript will run on IBM PCs and compatibles with
Hercules display cards if you redirect text output to a file.

Notes that the alternate DeskJet 500C driver (djet500c) does not work
on the 550C.

Gives a list of system-specific directories where Type 1 fonts are
likely to be installed, as a suggested setting for GS_FONTPATH.

</pre><h3><a name="V2.9b_Procedures"></a>Procedures</h3><pre>
Changes the distribution script so that it stores all text files in the
main source archive with Unix end-of-line conventions, but with DOS
end-of-line conventions in the MS-DOS-specific archive.

Changes the MS-DOS, MS Windows, and OS/2 makefiles so that 486SX and 486DX
processors are different CPU_TYPEs.  (The former, designated by
CPU_TYPE=485, does not include an on-chip FPU.)

Adds a line to gs_init.ps which can be uncommented to select A4 as
the default paper size.

Adds a definable CFLAGS macro to the makefiles, allowing -DA4 to
select A4 as the default paper size.

Adds the H-P printer drivers to the standard Unix configurations.

</pre><h3><a name="V2.9b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- If there were no unencoded characters, prfont.ps would get
an error.

Changes ansi2knr to accept a wider range of function declaration syntax,
and to not depend on any Ghostscript header files.

</pre><h3><a name="V2.9b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- Several drivers (DigiFax, Epson LQ-2550, NEC P6) didn't handle
A4 paper width.
	- The IBM ProPrinter wasn't being initialized properly.
	- The Epson driver didn't work properly with compilers that
insisted on 'char' being a signed type.
	- The Epson driver ignored its end_string argument, producing
incorrect end-of-page behavior on some printers.

Adds new drivers:
	- User-contributed drivers for Bellcore MGR (a window manager most
commonly used with OS-9) devices.
	- A user-contributed driver for the CIF file format.
	- A user-contributed driver for the HP 2563B line printer.

Changes the LaserJet 2p, 3, and 4 drivers so they set the initial position
to (0,0) rather than (0,0.25").  (I don't remember why it was the other
way.)

Implements the PageCount property in all drivers, not just printer
drivers.

Introduces a new gx_tile_bitmap type, and changes the tile_rectangle
device procedure to take it in place of gx_bitmap.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE.  However, it only affects devices that
implement their own tile_rectangle procedures, of which there aren't very
many.

</pre><h3><a name="V2.9b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The VMS module lists referred to SDCTD and SDCTE instead of
SDCT.
	- The Unix install script tried to install the non-existent file
readme.doc.
	- Microsoft C does something bizarre with empty macro parameters,
which caused a problem with the gs_struct_type_... macros.
	- The Unix platforms didn't automatically handle the presence
or absence of &lt;dirent.h&gt;.
	- The DEC Alpha OSF/1 1.3 library lacks `const' in the prototype
for popen, which requires a workaround.
	- The DEC Alpha OSF/1 1.3 X Windows library uses `private' as a
member name.

Splits off gp_unifs.c, containing code common to "Unix-like" file systems.

Adds a user-contributed OS-9 platform.

</pre><h3><a name="V2.9b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The currentfile cache wasn't updated properly if an executable
file appeared in the middle of a procedure.  In particular, eexec-encoded
.PFB fonts often didn't work.
	- There was an extraneous `goto top' in scfd.c.
	- An integer constant overflowed in iname.c.
	- -2147483648 (i.e., -1 &lt;&lt; 31) was converted to a float.
	- eexec didn't skip the first 4 characters correctly if they were
split across a buffer boundary.
	- The font/matrix pair cache didn't properly free entries with only
an XUID that was being deallocated.

Implements additional Level 2 features:
	- Patterns, makepattern, setpattern.
	- IODevice resource, setdevparams, currentdevparams.
	- OutputDevice resource, setpagedevice, currentpagedevice.
	(Partially implemented.)

Adds a new type t_struct to handle miscellaneous types that are allocated
as objects and that the interpreter doesn't handle specially, and changes
condition, fontID, gstate, lock, and save types to use t_struct.  (This is
an internal change, not visible at the language level.)

Moves the maxlength of a dictionary to its own ref, eliminating the "size
of integer" hack.  (This is an internal change, not visible at the
language level.)

Adds the last OS error number to the error printout.

Removes the obsolete framedevice operator.

Implements resetfile (the only Level 1 operator not yet implemented!).

Changes the name of the getdevice operator to .getdevice.

</pre><h3><a name="V2.9b_Library"></a>Library</h3><pre>
Fixes bugs:
	- A couple of necessary casts from char * to byte * were omitted.
	- A Sun compiler required an extra cast to (void *) in the e1
macro in clip_rect_enum_ptrs in gxcpath.c.
	- The gx_dc_ procedures defined in gxdraw.c weren't marked as
'private'.
	- The number of "on" pixels in a halftone cell sometimes varied by
1 from cell to cell.
	- Mapping a gray level to CMYK didn't subtract it from 1 (to
produce the K component).
*	- charpath took hints into account.

Shuffles the order of some declarations to pacify the VMS C compiler.

</pre>

<hr>

<h2><a name="Version2.8b"></a>Version 2.8-beta (11/10/93)</h2>

<p>This version was distributed only to beta testers.  It adds Type 0
font
support.  It also includes extensive redesign of streams (to eventually
support procedure streams) and device properties (to eventually support
get/setpagedevice and get/setdevparams).

<h3><a name="V2.8b_Documentation"></a>Documentation</h3>

<pre>
Notes the change in X11 foreground/background handling.

Changes README so it no longer claims that Ghostscript works with X11R3.

Notes (in devs.mak) that the cdjmono driver is the best one to use for the
DeskJet 510.

</pre><h3><a name="V2.8b_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- echogs wasn't always invoked with ./ on Unix systems.

Changes the file name unix-ansi.mak to unixansi.mak, so it can be created
on a MS-DOS system.

Adds a new "feature", ccinit.dev, which compiles and links the
initialization files (gs_*.ps) into the executable, just as ccfonts.dev
compiles and links fonts.  If ccinit and ccfonts are both selected, the
only external file needed at run time is Fontmap.  Note that you must have
a working version of Ghostscript already in order to create a version that
uses the ccinit feature, just as for ccfonts.

</pre><h3><a name="V2.8b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- the ps2image utility didn't put a %! on the first line of the
output.

</pre><h3><a name="V2.8b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The Hercules display driver didn't include definitions for
outport2 and PAGE_HEIGHT_INCHES, which it uses.
	- The BGI driver didn't call setactivepage or setvisualpage,
which it needs to do in general.
	- The Apple DMP driver declared dmp_print_page rather than
appledmp_print_page, causing a compilation error.

Changes the X11 driver so that it doesn't use the default foreground and
background colors: you must set foreground and background explicitly for
Ghostscript if you want them to be other than black and white
respectively.

Adds new user-contributed drivers for:
	- The StarJet 48 inkjet printer;
	- The Linux VGALIB display interface.
	- OS/2 Presentation Manager.

Changes the margins of the Epson driver to 0.2, 0.0, 0.0, 0.0, which
more accurately reflect the printer's capabilities.

Changes the get_props and put_props device procedures to take property
list "objects" with a procedural interface, rather than a data structure
interface.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.  It affects all
get_props and put_props procedures.  Fortunately, there were only a few
devices that implemented their own get_props and put_props procedures (the
H-P color printers, and the three window systems -- X Windows, MS Windows,
and OS/2 PM).

</pre><h3><a name="V2.8b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The meaning of the -p switch for the Watcom compile-and-link
program was changed between Watcom C/386 versions 8.5 and 9.5, causing the
make process to malfunction.
	- The SCFTAB and SCFDTAB modules were omitted from the VMS link
list.

Adds user-contributed code for OS/2.

Removes the assumption that an 80486 CPU implies the presence of hardware
floating point, since the 486SX and Cyrix 486SLC don't have it.

</pre><h3><a name="V2.8b_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
*	- The GS_FONTPATH scanner didn't recognize .PFB fonts beginning
with %!PS-AdobeFont.
*	- The GS_FONTPATH scanner often didn't recognize .PFB fonts at all.
	- Type 1 fonts always set the line join, line cap, and miter limit
to known values, rather than using the current values.  (Using the current
values doesn't make much sense, but it's apparently what the Adobe
implementations do.)
	- DISKFONTS didn't work, because of the change in the Ghostscript
fonts to do a systemdict begin/end (in version 2.7.1).

</pre><h3><a name="V2.8b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- == didn't produce exactly the same output as the Adobe
interpreters.  (Some automated debugging and testing programs care.)
	- The CCITTFaxEncode filter could get caught in an infinite loop,
because it failed to mask a byte datum when scanning for runs of black
pixels.
	- The write operator gave an error for values outside the range 0
to 255, rather than just using the low-order 8 bits.
	- Some applications call a statusdict procedure named
setresolution without checking first whether it is present; Ghostscript
didn't provide one.
	- Reading from a closed stream caused an error instead of
returning EOF.
	- Input streams didn't close automatically at EOF.
	- findfont was defined as an operator, not a procedure.
	- closefile on a closed file gave an error.  (It isn't obvious
that the Adobe documentation specifies that it shouldn't, but that's what
Adobe says they do.)
	- The LZWDecode filter didn't handle codes representing strings
longer than the buffer size correctly.
	- The LZWDecode filter only allowed 4095 codes to be used, rather
than 4096.
	- The rand operator produced an infinite string of zeros if
given 0 or 0x7fffffff as the seed.
	- When a CDevProc procedure was called, there was an extra
copy of the character name on the operand stack below the operands of
CDevProc.

Replaces all stream implementations with new ones designed to allow
interruption at arbitrary times.  ****** The 2-D case of CCITTFaxEncode
hasn't been converted (but it probably didn't work before, either).

Implements additional Level 2 features:
	- Type 0 (composite) fonts.

Adds an eexecEncode filter.

Implements setcolorscreen, which was accidentally omitted from 2.7.

</pre><h3><a name="V2.8b_Library"></a>Library</h3><pre>
Fixes bugs:
*	- In colorimage, if the color space of the image was different
from the current color space, and the first data values on a scan line
were zeros, the wrong color could result.
	- The new flatness testing algorithm could overflow, producing
straight lines or obvious polygons instead of curves.
	- Images could fail to display pixels after the first non-blank
pixel on a line if halftoned color was required.  (This bug was probably
introduced in 2.7.)
	- Interpolation between transfer map entries didn't work, because
of a rounding/truncation bug in frac2bits (bug introduced in 2.7.1.)
	- cshow did an extra grestore at the end.

* Implements a hack to slightly displace 1-bit-wide or -high images.  This
is necessary to work around a bug in TeX (or dvips?), which uses such
images to draw horizontal and vertical lines without positioning them to
ensure that they cover device pixel centers.

Adds support for composite fonts (no new client procedures).

</pre>

<hr>

<h2><a name="Version2.7.2b"></a>Version 2.7.2-beta (10/11/93)</h2>

<p>This version was distributed only to alpha testers.

<h3><a name="V2.7.2b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- prfont.ps didn't print unencoded characters.

Improves mergeini.ps to remove embedded comments.

</pre><h3><a name="V2.7.2b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- An error occurring within the scope of an internal .stopped
didn't pop the command and error name off the stack.
*	- The = and == procedures weren't re-entrant.

* Adds a .writecvs operator that does a cvs to an internal string followed
by a writestring.

</pre><h3><a name="V2.7.2b_Library"></a>Library</h3><pre>
Fixes bugs:
	- grestore freed the path and the clip path in an order that
was likely to lead to memory sandbars.
	- moveto + closepath didn't actually close the path.
	- moveto + reversepath produced an empty path (no moveto).
	- moveto + closepath + reversepath produced an extra lineto.
	- reversepath didn't set the current point to the end (i.e., the
former beginning) of the last subpath.

Adds a "planar" memory device.

</pre>

<h2><a name="Version2.7.1b"></a>Version 2.7.1-beta (10/4/93, not distributed to the public)</h2>

<p>Like 2.7, this version was created to satisfy a contractual
requirement,
and will never be distributed to anyone other than the other party to the
contract.

<h3><a name="V2.7.1b_Documentation"></a>Documentation</h3><pre>
Documents the GS_OPTIONS environment variable.

Adds a summary of all environment variables to the documentation
(use.doc).

Documents the existence of a third free viewer built on Ghostscript.

</pre><h3><a name="V2.7.1b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- wrfont didn't wrap a systemdict begin / end around the body of
the font.
	- wrfont wrote out the Symbol and ZapfDingbats encodings in a way
that only worked if the encoding was known by name.

Changes bdftops to include an XUID if desired.

Changes bdftops so that it uses 'show' for unknown ligatures, rather than
executing the characters as subroutines; this makes such ligatures work
properly with xfonts.

</pre><h3><a name="V2.7.1b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The PCL drivers sent a printer reset (&lt;ESC&gt;E) at the beginning
of every page, instead of only before the first page.
	- The PCX driver didn't round up the scan line width in the
header, even though it produced scan lines with the correct (rounded)
number of bytes.

Adds a new map_rgb_alpha_color procedure.  This is a backward-compatible
change; this procedure defaults to calling map_rgb_color.

</pre><h3><a name="V2.7.1b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- On Unix platforms, the value of the TEMP environment variable
had to end with a '/'.
	- On MS-DOS systems, printer output to devices other than PRN
(specifically, LPTn) didn't put the device into binary mode.

Adds FPU_TYPE to the Unix makefiles, with a default value of 1.

Removes the mention of Xmu linking problems on the SunOS platform,
since the problem no longer exists.

Changes the order of X Windows libraries from Xt X11 Xext to Xt Xext X11.
This makes the OSF/1 linker happier.

</pre><h3><a name="V2.7.1b_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
	- All the fonts originated by Aladdin, and the shareware fonts,
had UniqueIDs in the 4xxxxxx range, which is only supposed to be used for
limited-distribution fonts.
*	- When Ghostscript loaded a font, it pushed a scratch dictionary
on the dictionary stack, rather than userdict.  (Note that this fix also
requires fixing the fonts to include a protective systemdict begin /
end; see below.)
*	- When loading a font failed, Ghostscript didn't check the font
name against the default font name properly.
	- Ghostscript's own fonts didn't include a systemdict begin /
end to guard against redefinition of names used in the reading
procedures (e.g., index).
*	- When Ghostscript scanned a .PFB font to get the FontName, it
didn't skip over the 6-byte header, which could cause confusion or a
syntaxerror.
	- Loading a .PFB font that left extra information on the
operand stack didn't work.

Changes the ZapfDingbats font to use DingbatsEncoding rather than include
a copy of the encoding in itself, if DingbatsEncoding is known.  Changes
the Symbol font similarly.

Removes eexec encryption from the 4 URW fonts, so they will work with
DISKFONTS.

Adds shareware Hiragana and Katakana fonts (Calligraphic-Hiragana and
Calligraphic-Katakana, by Kevin Hartig).

Adds GS on the end of the family names of all of Aladdin's own converted
fonts.

Replaces many of the Hershey fonts with new ones (mostly Type 1) created
by Thomas Wolff, who added accents, accented characters, and other
non-alphabetics.  These too now have proper UniqueIDs.

</pre><h3><a name="V2.7.1b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
*	- imagemask interpreted the Decode array incorrectly (inverted).
	- Running out of memory when constructing a path incorrectly
signalled a limitcheck rather than a VMerror.
	- restore didn't purge uncached scaled fonts properly.

Adds alpha (opacity) to the graphics state, and setalpha and
currentalpha operators.

Redefines erasepage in terms of a new .fillpage operator that fills
the current page with the current color and then does a sync_output.

Redefines setdevice and putdeviceprops in terms of new .setdevice and
.putdeviceprops operators that return a boolean indicating whether the
page needs to be erased.  With this change, operators that erase the page
always call erasepage at the interpreter level rather than calling
gs_erasepage directly.

</pre><h3><a name="V2.7.1b_Library"></a>Library</h3><pre>
Fixes bugs:
	- The null device allowed its size to be reset.
	- clippath didn't establish a current point if the clipping
path was empty.
*	- The Type 1 font interpreter (gs_type1_interpret) flattened
curves even if it was being invoked for charpath.
	- Colored halftones usually didn't come out with the correct
phase, and had several other problems.
	- A show or charpath within a BuildChar procedure didn't work.
	- Accented characters composed with seac used the base
character width instead of the composed character width.  (The Adobe
documentation says these must be the same, but some commercial fonts
don't obey this.)
	- setcurrentpoint in the accent of a character composed with
seac didn't take the accent's displacement into account.

Adds an alpha (coverage) value to the graphics state, and
gs_setalpha/currentalpha procedures.  Currently Ghostscript just passes
the alpha value to the driver; it doesn't attempt to emulate alpha
handling if the driver doesn't support it.

Redefines gs_erasepage to call gs_fillpage.

Bypasses the fill code if the clipping box is empty.  This makes a big
difference for stringwidth, and doesn't hurt anything else.

Changes frac_1 from 0x7fff to 0x7ff8.  This allows exact representation of
practically all useful fractions, since this number (32760) is
2*2*2*3*3*5*7*13.

Changes float to double in several matrix routines for better accuracy.

Adds new device properties to implement the deviceinfo operator:
Colors, GrayValues, RedValues, GreenValues, BlueValues, ColorValues.
Also adds HWBitsPerPixel and HWColorMap.

Changes the sorting algorithm for halftones to use qsort instead of
special code.

Changes the Type 1 interpreter so that it uses the current point, rather
than (0,0), as the character origin.

</pre>

<h2><a name="Version2.7b"></a>Version 2.7-beta (9/20/93, not distributed to the public)</h2>

<p>This is the first of a series of beta-only versions planned for
release
between 2.6.n and 3.0.  This version, in particular, was created to
satisfy a contractual requirement, and will never be distributed to anyone
other than the other party to the contract.

<h3><a name="V2.7b_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The "HP XLFD extensions" to X11R5 are not specific to H-P
platforms.
	- The configuration generation script used rm rather than rm -f.
	- gs.1 was installed in $(docdir) rather than $(mandir);
$(mandir) wasn't defined.
	- ansi2knr.1 was installed in $(docdir), which was
inappropriate because ansi2knr itself wasn't installed anywhere.

Moves documentation for versions 2.4.x and 2.5.x to history.doc.

Moves the documentation on how to add devices to the configuration
from devs.mak to make.doc.

Changes the name of readme.doc to current.doc, since the presence of
two "readme" files was confusing to users.

Documents how to use the Microsoft Windows PostScript printer driver
to convert TrueType fonts to Type 1 fonts embedded in the document.

Corrects several errors in the documentation of the get_bits driver
procedure.

Documents the fact that X11R3 is no longer supported.

Removes the last references to "Ghostscript" from the comments in the
gs_*.ps files.  The only remaining reference, other than the boilerplate
comments at the beginning of each file, is in the message at the end of
gs_init.ps.

Documents the use of WMAKEL rather than WMAKE with the Watcom compiler.

</pre><h3><a name="V2.7b_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
*	- The Unix install script used gs rather than $(GS) as the name of
the executable.
*	- The Unix install script didn't copy gs_dbt_e.ps to $(gsdatadir).
	- genconf.c used ps2 as a variable name; ps2 is a predefined
preprocessor symbol in the VSC compiler used by IBM.
	- @-expansion didn't interact properly with -- and -+.
	- The Unix install script didn't copy COPYING to $(docdir),
and copied README to $(gsdatadir) rather than $(docdir).
	- ps2ascii used /bin/sh -f, which is an incorrect flag.

Removes all uses and mentions of USG (a now-obsolete GNU convention)
as a synonym for SYSV.

Removes filter.dev and dps.dev from FEATURE_DEVS if level2.dev is
included, since they don't add anything beyond level2.dev.

Changes the ccgs script to explictly remove the old .o file before
doing the mv, for the benefit of people who have changed mv to prompt
before overwriting.  Changes the configuration script to use rm -f
for the same reason.

Changes the -Z switch so an empty list of options does nothing, rather
than turning on all options.

Adds a -@ switch which is like -- and -+ except that it does
@-expansion of arguments.

Changes genconf so it takes patterns from the command line that describe
how to write the linker control files, rather than having the patterns
built in.

Changes -d and -D so that if no value is supplied, the default is
true rather than null.

</pre><h3><a name="V2.7b_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
*	- The ps2ascii script still referenced ps2ascii.ps under its
old name gs_2asc.ps.
*	- ps2image.ps had a 'pop' missing in the written-out
definition of 'max' in the boilerplate code it put at the beginning
of compressed files.
*	- ps2image.ps got a typecheck if a scan line had no repeated
data in it anywhere.
	- wrfont.ps didn't handle CharStrings or Subrs that weren't
strings.
	- mergeini.ps produced an init file that incorrectly
attempted to load the Symbol and Dingbats encodings dynamically.

Removes the gsview.bat file, since it was confusingly named and not
generally useful.

Changes bdftops back to using encrypted CharStrings, for compatibility
with Adobe interpreters, but also changes lenIV to 0, to save a little
more space.

Changes the traceop utility so it makes traced operators appear to be
operators, and so it will replace a definition in systemdict if explicitly
requested to do so and systemdict is writable.

Adds a printafm utility for printing the metrics of fonts in AFM format.

</pre><h3><a name="V2.7b_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The cdj driver was missing a few type casts that were needed to
satisfy pedantic compilers.
	- For banded devices, many of the non-displaying target routines
were getting called with the original device as the first argument, not
the target device.  (This didn't make any difference in practice, because
gdev_prn_open explicitly copied the non-rendering procedures back into the
procedure vector.)
*	- The X driver didn't catch and discard bogus errors on
XFreeColors, which faulty servers generate.
*	- The X driver gave up on color allocation too easily.
*	- The X driver dynamic color table size could become negative.
*	- x_lookup_font could return platform fonts of very small sizes,
which have very inaccurate metrics.
*	- The ESCP/2 driver was incorrectly named gdevescp2 in devs.mak.
	- The Apple DMP driver used #if 0 / #endif instead of comment
brackets, and was incorrectly named "dmp" instead of "appledmp" in
the source code.
*	- The X driver didn't free dynamic colors at the start of each page.
*	- The X driver didn't bind foreground/background defaults tightly.
*	- The X driver didn't check for GHOSTVIEW_COLORS properly.
*	- The X driver freed too many colors if an allocation request failed.
*	- The X driver didn't check return value of gs_malloc for being NULL.
*	- The DeskJet/LaserJet driver used an incorrect command for
end-of-page.
*	- The DeskJet/LaserJet driver incorrectly reset the printer at the
beginning of every page.
*	- The PCX driver put an old version number in the header, and
didn't pad scan lines to an even number of bytes.
	- The BMP driver used a variable named `quad', which is a
reserved word on some platforms.
*	- The TIFF driver didn't handle A4 or B4 size paper correctly.
*	- The X11 driver incorrectly demanded the Xmu library, which was
not needed and which caused link errors on some versions of SunOS.
*	- X11 font matching scheme was too loose, causing overlaps and
other problems.
*	- X11 Font Extensions (rotated and mirrored fonts) did not work
properly on NCD terminals.
*	- When freeing the rgb cube/gray ramp, the parameters to gs_free()
did not exactly match the parameters to gs_malloc().
*	- Ghostscript failed to warn the user when it could not allocate
the original color cube/gray ramp and dropped back to a smaller
cube/ramp, or from color to mono.
*	- x_release could cause Ghostscript to fail if a font was freed
after the device was closed.
	- The X driver continued to ask the server for colors even after a
request failed, causing colored images to display very slowly.

* Adds a pcxgray driver to provide 8-bit gray scale output in PCX format.

Adds a pcx24b driver to provide 24-bit RGB color PCX output.

* Adds a LaserJet 4 driver.

Adds a user-contributed driver for the DEC LA70 (very similar to the LA75).

Substantially improves the performance of the PxM drivers by eliminating
an unnecessary copying step and by writing each scan line with a single
fwrite when possible.

Moves the gray-scale and 24-bit RGB device color mapping routines to
gxcmap.c from gdevpcx.c and (nowhere).

Allows window granularities smaller than 64K in the VESA driver.

Changes the LaserJet margins again.

</pre><h3><a name="V2.7b_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- Platforms where stat doesn't return a st_blocks value
computed the block count wrong.
	- In gp_vms.c, the call on SYS$FILESCAN needed two uint *s
rather than a long * and a struct *.
*	- The VMS script files referenced IBSCAN instead of ISCAN2,
and omitted GDEVXXF.
*	- The UUENCODEd icons for the MS Windows platform were omitted
from the fileset.
*	- On MS-DOS systems, filenameforall didn't interpret * alone
as a pattern matching all files.

Adds wildcard matching capability to filenameforall under Unix.

Removes gp_file_status from the platform interface, since all
platforms provide identical stat calls in the C library.

Adds DesqView/X (using djgcc and go32) as a platform.

Removes the S3 driver from the standard PC configurations.

Adds documentation for compiling Ghostscript on the Intergraph Clipper.

Updates the documentation to add a better list of X Windows font
names for the Sun platform.

</pre><h3><a name="V2.7b_Fonts"></a>Fonts</h3><pre>

Creates an external file (gs_dbt_e.ps) with the ZapfDingbats encoding
(actually in 2.6.1, but not documented there).

Changes the names of the Cyrillic fonts to Shareware-Cyrillic-Regular
and Shareware-Cyrillic-Italic, keeping Cyrillic, Cyrillic-Regular,
and Cyrillic-Italic as aliases.

* Removes the requirement that the FontName in the font file be the same
as the name in Fontmap.  (This requirement led to the need for aliases,
and was extremely confusing to users.)

* Adds a GS_FONTPATH environment variable containing a list of directories
that should be scanned automatically for fonts.

* Gets rid of the Ugly font, and changes the default to the IBM Courier
font, which is freely distributable.

</pre><h3><a name="V2.7b_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- cvs didn't check for stack underflow.
*	- zht2.c didn't include alloc.h.
*	- execstackoverflow cleared the e-stack instead of just
cutting it back.
	- if and ifelse incorrectly reported typecheck instead of
stackunderflow.
	- Copying a dictionary could alter some items even if a later
item causes an invalidaccess error because of an attempted store of a
local object into global VM.
	- bitshift and cvrs assumed that longs occupied 32 bits.
*	- exitserver didn't check the password, and always succeeded.
	- Font loading didn't suppress all output messages if QUIET
was set.
*	- The interpreter incorrectly pushed its exit procedure on
the e-stack if it was called again after an interrupt.
*	- The interpreter didn't treat timeout like interrupt in
terms of re-executing the current operation.
*	- `show' operators popped their operands before they were
sure they wouldn't be interrupted.
*	- rotate with a matrix operand didn't check for multiples of
90 degrees.
	- In the system name table, ge was misspelled eg, and
pathforall was misspelled pathfoall.
*	- file_close_file attempted to free the buffer even if it was an
externally supplied string (specifically, the argument of gs_run_string).
	- setprintername (in gs_statd.ps) set printername rather than
.printername.

Implements additional Level 2 features:
	- Indexed color space with lookup procedure.
	- sethalftone, except for the transfer function override,
	and currenthalftone.

Implements OtherSubrs for indices greater than 3 (required for
MultiMaster fonts).

Implements black generation and undercolor removal.

Changes `store' from a C procedure to a PostScript procedure.

Changes idiv back so it requires integer operands, per the Adobe
documentation but not per some old Adobe interpreters.

* Adds many new paper sizes to gs_statd.ps.  It now includes ISO a0-a10
and b0-b10, and CAD sizes archA-archE.

Implements `status' for non-%os% files.  (This is currently a no-op,
but the framework is there.)

Changes the error handler so it normally uses = rather than == to print
the operand stack, to avoid recursive errors.

* Adds time slicing capability to the interpreter.

Implements setcolorscreen/currentcolorscreen.

</pre><h3><a name="V2.7b_Library"></a>Library</h3><pre>
Fixes bugs:
*	- Rectangles with vertices specified in clockwise order were
drawn as 0-width lines.
*	- The string matching function reported that 'abcdefg'
matched the pattern 'abcde'.
*	- The bounding box of non-rectangular clipping paths was not
being marked as valid, so cached characters would simply get
discarded as being outside the bounding box.
	- erasepage filled the page with the device's white color,
not with gray level 1 passed through the transfer function.
*	- Colors with equal R/G/B or C/M/Y components were rendered
incorrectly if the 3 or 4 transfer functions were not all the same.
*	- Because of a bug in rc_unshare, using CIE color would give
random errors (such as /invalidaccess in --for--).
*	- setbbox didn't round the coordinates properly, which could
cause erroneous rangecheck errors with coordinates on the edge of the
box.
*	- Color halftones "flipped over" at the 50% point, inverting
foreground and background.
	- Quite a few places assumed that longs occupied 32 bits.
*	- kshow passed an incorrect c1 value to the procedure.
	- The debugging code in update_x_list in gxfill.c didn't take
into account the possibility that the active line at x_first might be
deleted.
	- gx_image_cached_char called the xfont render_char procedure an
extra time if it failed with required=0 and succeeded with required=1.
(This was just a small inefficiency, not a logic bug.)
	- Non-rectangular clipping regions weren't computed correctly,
because accum_add_rect didn't handle overlapping rectangles.
	- Drivers didn't report file system errors (such as file system
full) as an ioerror.
*	- setdevice didn't reset the charpath and setcachedevice flags.
	- The Zortech compiler produced wrong code for the uid_equal
macro; uid_equal is now a procedure.

Passes OtherSubrs arguments back to the caller correctly for indices
greater than 3.

Implements black generation and undercolor removal.

Removes gdev_mem_ensure_byte_order, which was no longer used or useful.

Removes gstdev.c (device tracing), since it hasn't been used in a
long time and is of little value given a reasonable debugger.

Changes the interface to the xfont char_metrics and render_char
procedures to allow them to return 1.

Changes 32-bit memory devices so they use CMYK color mapping rather
than RGB mapping with an unused byte.

Implements gs_setcolorscreen/currentcolorscreen.

Implements Level 2 halftones, except for the transfer function override.

Implements a hack to make zero-width rectangles display as one pixel wide,
to work around a bug in the Microsoft Windows PostScript driver.
Currently the hack only works for vertical lines, not horizontal ones.

</pre>

<hr>

<h2><a name="Version2.6.1"></a>Version 2.6.1 (5/28/93)</h2>

<p>This is primarily a bug-fix release for 2.6, with a couple of minor
additions.

<h3><a name="V2.6.1_Documentation"></a>Documentation</h3><pre>

Adds proper `man' pages ansi2knr.1 and gs.1.

</pre><h3><a name="V2.6.1_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The Unix makefile produced an incorrect linker command if
EXTRALIBS was not empty.
	- The Unix install commands didn't copy devices.doc,
ps2epsi.doc, and xfonts.doc to the documentation directory.
	- echogs.c didn't include &lt;sys/types.h&gt;, which is needed for
time_t on some systems.
	- malloc_.h used &lt;malloc.h&gt; rather than &lt;stdlib.h&gt; on
NeXTStep systems.

Changes the configuration procedure to use a C program rather than
complex shell scripts.

</pre><h3><a name="V2.6.1_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- The boilerplate produced by ps2image used the 'max'
operator, which is not a standard PostScript operator.
	- The winmaps.ps utility had 'floring' instead of 'florin' in
the OEMEncoding table.
	- quit.ps was omitted from the PC distribution.

Changes the name of the dicttomark procedure to .dicttomark.

Renames gs_2asc.ps as ps2ascii.ps, so it matches the names of the
script files.

</pre><h3><a name="V2.6.1_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The pbmraw driver was writing out RGG instead of RGB values.
	- The X11 driver used NULL in a place where it should have
used None.
	- For multi-file output, the GIF driver didn't write a header
at the beginning of each file.
	- The Epson driver didn't honor the -A4 compilation switch,
didn't put (0,0) at the physical corner of the page, and was too
liberal about using tabs instead of spaces.

Replaces the color handling algorithms in the X Windows driver with
new, much better ones.

Makes the PC display drivers recognize the -A4 compilation switch,
like the printer drivers.

Adds new user-contributed drivers:
	- A driver for Epson printers that use the ESC/P 2 control
language, such as the Stylus 800.
	- A driver for the Apple Dot Matrix Printer and Imagewriter.

Adds a new get_xfont_device driver procedure.  This is a
backward-compatible change, since there is a sensible default.

</pre><h3><a name="V2.6.1_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- On VMS, gconfig.h didn't have #include "gsconfig.h" as its
first line.
	- gconfig.c compiled incorrectly on the RS/6000 because the
compiler evaluated a constant of the form (x&lt;&lt;y)+z incorrectly.
	- Quite a few files that used the mem... functions didn't
include memory_.h, which caused trouble on some bsd4.2 systems.
	- The definition of zfont_char_xglyph confused one of the AIX
compilers.
	- On VMS, DEC C allows extra arguments for fopen, but gcc doesn't.
	- On the MS Windows platform, 2.6 used gdevwddb rather than
gdevwdib; the latter is almost always faster.
	- The PC .zip files didn't include the Windows .ICO and .RES
files in either GSEXE.ZIP or GSFILES.ZIP.

On PC platforms, adds an option (FPU_TYPE=-1) to optimize for
machines lacking a floating point processor.

</pre><h3><a name="V2.6.1_Fonts"></a>Fonts</h3><pre>

Adds 4 new fonts contributed by URW.  These have a URW copyright and
are governed by the GNU License.

Documents the fact that font names in Fontmap can be strings, not
only names.

Adds DingbatsEncoding as a predefined encoding (in addition to
Standard, ISOLatin1, and Symbol).

</pre><h3><a name="V2.6.1_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- memchr (used in zfile.c) isn't available on all platforms.
	- languagelevel was defined as an operator rather than an
integer.
	- iccfont.c referred to name_StandardEncoding instead of
#include'ing font.h and referring just to StandardEncoding.
	- The CCITTFaxDecode filter didn't work on 32- (or 64-) bit
machines, because of a bug in more_bits().
	- The structures recording an allocation within the scope of
a save could get allocated unnecessarily, because they weren't
properly marked as free when an array was freed.

Renames the following Ghostscript-specific operators by adding a '.'
at the front: makeoperator, setdebug, setmaxlength, stringmatch,
type1decrypt, type1encrypt.

Adds a real implementation of glyphshow.

</pre><h3><a name="V2.6.1_Library"></a>Library</h3><pre>
Fixes bugs:
	- Discarding fractional character coordinates in the Type 1
rasterizer led to some rendering anomalies (e.g., characters 1 pixel
too high).
	- If a font had a non-standard encoding (i.e., not
StandardEncoding, ISOLatin1Encoding, or SymbolEncoding), Ghostscript
would never invoke the platform font code.
	- The RGB to HSB color conversion algorithms produced
nonsensical values.
	- struct cached_char_s was defined redundantly in gxcdir.h,
causing compilation problems on some systems.
	- 32-bit color devices didn't work properly on little-endian
machines (arrange_bytes in gdevmem2 was wrong).
	- The scaled font cache could confuse two fonts with the same
UniqueID and different Encodings.
	- Under many common circumstances (first use of a character
was with stringwidth, the font was renamed, the font encoding was
changed), xfonts would not be used.

Adds gs_glyphshow.

</pre>

<h2><a name="Version2.6"></a>Version 2.6 (5/9/93)</h2>

<p>The main new feature in this release is the ability to use platform
fonts.  It also adds many more Level 2 PostScript facilities.

<h3><a name="V2.6_Documentation"></a>Documentation</h3><pre>

Corrects some errors in the documentation of the makeimagedevice operator.

Adds operand and result types to the comments at the beginning of all the
operators.

Adds new sections on installation in use.doc.

Reinstates history.doc as a repository for old and no longer interesting
history information.

Adds a new file, devices.doc, with documentation for specific devices.

Points out that font2c must be run with a Fontmap that includes the fonts
being converted, and that its arguments must be quoted with "" on VMS
systems.

Notes that the font name in the Fontmap must be the same as the FontName
in the font.

Adds a list of the Level 2 facilities not provided by Ghostscript.

Identifies bug-ghostscript@prep.ai.mit.edu as an alias for the
gnu.ghostscript.bug newsgroup.

Points out explicitly that -sOutputFile=- sends output to stdout, and
requires using the -q switch.

Documents the use of tar_cat to construct the Unix makefiles.

Adds a new file, xfonts.doc, that describes the external font interface.

Documents the fact that drivers must use gs_malloc and gs_free rather than
malloc and free.

Documents the *.sh (shell script) files.

Adds brief documentation on some additional development tool .ps files.

Documents the TEMP and GS_OPTIONS environment variable.

Points out the need to run Windows in 386 Enhanced mode on machines
that have less than 6 Mb of RAM.

Consolidates documentation on compiler switches in make.doc (some of
it had been in the unix*.mak files).

</pre><h3><a name="V2.6_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- \'s in arguments following -- were doubled.

Includes the full set of filters automatically if the level2 feature
is selected.

Extends DEVICE_DEVS... up to DEVS9.  Adds DEVICE_DEVS1 as well.

Renames turboc.mak and tbcplus.mak as tc.mak and bc.mak.

Makes @-files use the library path (GS_LIB, -I).

Changed the Unix install script to use install &lt;file&gt; &lt;destfile&gt;
rather than install &lt;file&gt; &lt;directory&gt;.

Adds a GS_OPTIONS environment variable that acts like an implicit @-file
at the beginning of the command line (i.e., may contain switches and
initialization files).

Renames sym__enc.ps as gs_sym_e.ps.

Adds a user-contributed shell script for using Ghostscript with an
H-P printer spooler.

Adds level1.ps to the set of installed utility files.

Extends the TEMP environment variable (the directory for scratch
files) to work on Unix as well as MS-DOS.

Changes the MS Windows makefile to generate gswin.exe rather than
gs.exe, and the Watcom makefile to generate gs386.exe.

Moves the "product" string from gs_init.ps to iinit.c.

Adds a GS macro to the makefiles, to allow choosing the name of the
executable.

</pre><h3><a name="V2.6_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
*	- font2c did the wrong thing (still) for fonts that didn't
use StandardEncoding, ISOLatin1Encoding, or SymbolEncoding.
*	- impath.ps had a fatal bug (wrong operand order for
charstack_write) that caused bdftops to fail.
	- gslp didn't wrap or truncate lines.
	- gslp didn't handle tabs in a second or subsequent column
properly.
	- The definition of ashow in gs_2asc.ps incorrectly undid the
increment following the last character.
	- The definition of awidthshow in gs_2asc.ps failed to pop
two entries from the stack, and also tested the character against the
wrong value.

Adds a shell script (sysvlp.sh) that interfaces Ghostscript with the
System V 3.2 lp interface.

Adds ps2ascii and ps2epsi script/batch files.

Adds a new utility, mergeini.ps, for concatenating all the
Ghostscript initialization files into a single file, optionally
removing comments and blank lines.

Adds new switches to gslp:
	-q: suppress all printed output.
	--detect: check whether the file begins with %!, and if so,
	    interpret it directly as a PostScript file.
	--first-page &lt;page#&gt;: replaces the former -P switch.
	--last-page &lt;page#&gt;: replaces the former -Q switch.
	--(heading|footing)-(left|center|right) &lt;string&gt;: define
	    headers/footers.  # inserts the page number.
	--margin-(top|bottom|left|right) &lt;inches&gt;: define margins.
	--spacing &lt;n&gt;: for double, triple, etc. spacing.
Also makes gslp ignore all the enscript flags it doesn't implement.

Adds an option to wrfont.ps to do encryption at read-in time.  (This
allows much better compression of the standard Ghostscript fonts.)
Changes bdftops to use this option.

Changes gslp to accept wild cards in file names.

Replaces landscap.ps with a new one contributed by a user.

Changes the compression scheme used in ps2image to a much more
effective one.  Writing images is much slower than with the previous
scheme, but reading is not.

</pre><h3><a name="V2.6_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- SCFDTAB and SCFTAB were omitted from the VMS module lists.
	- Function prototypes were not being used with the Watcom
compiler.
	- On MS-DOS platforms, if the value of the TEMP variable had
a trailing : or \, Ghostscript appended a \ anyway.
	- Under Windows, changing the size or resolution of the image
closed and reopened the window.
	- Ghostscript would not build correctly with the Watcom compiler
if DOS4G=quiet was not set, because the DOS4GW copyright message was sent
to stdout.
*	- Finally gets Ghostscript to run properly on the RS/6000, by
adding a compiler bug workaround to arc_add and arc_either.
*	- Finally gets Ghostscript to compile properly on Sun SPARC
systems, by adding a compiler bug workaround in scan_number.

Changes the default MS-DOS configuration from 8086/8088 to 80286.

Adds all the SuperVGA drivers to the BC++ and Watcom executables
(except for the VESA driver in the Watcom executable).

Adds a makefile (msc.mak) for the Microsoft C/C++ 7.0 platform.  This
is currently a MS-DOS, not a MS Windows, platform.

Changes gp_enumerate_files_init so it takes a gs_memory_procs *, not
separate proc_alloc_t and proc_free_t arguments; also, it must
enumerate precisely the requested set of files, not a superset.  THIS
IS A NON-BACKWARD-COMPATIBLE CHANGE.  It affects all gp_*.c files.

Adds the P*M drivers and bit.dev to the standard configuration on
Unix platforms.

Changes the Watcom makefile so it uses the WATCOM environment variable (by
default) as the base directory for the Watcom executables.

Adds the MS Windows COMMDLG.DLL and SHELL.DLL files to the set of
files incorporated in GSEXE.ZIP, since the new MS Windows code uses
them, and they aren't provided with Windows 3.0.

Makes major revisions to the MS Windows platform and driver code, to
support the gsview front end, and also to remove the dependence on the
Borland EasyWin library.  NOTE: Compiling the MS Windows code now requires
Borland C++ 3.1 (not 3.0).

Changes time_.h so that Ghostscript will compile and run on A/UX.

Changes the MS-DOS implementation of file enumeration so it always
treats \s in the file name as literal characters, not escapes, unless
there are two \\s in a row.  This does the most sensible thing given
the DOS file naming conventions.

Adds a %pipe% file device under Unix.

Adds a makefile for Watcom C under MS Windows.  This is very preliminary;
in particular, NO display output is supported.

</pre><h3><a name="V2.6_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
	- fonts.mak referred to ncri and puti rather than ncrri and
putri.
	- cyr and cyri had the wrong protection.
	- The Hershey fonts left the font on the stack when they were
loaded.
*	- The FontName of an aliased font was the original FontName
from the file, not the alias.
*	- Fontmap.BTS had incorrect entries for AvantGarde-Demi and
AvantGarde-DemiOblique.
	- Ghostscript pushed userdict, rather than an empty writable
dictionary, onto the stack when loading a font, leading to name clashes.

Adds a new cfonts.mak with a full set of rules for compiling all the
standard Ghostscript fonts (except the Hershey fonts) into C.

Adds UniqueIDs to the Hershey fonts, and removes the UniqueIDs from
the Hershey entries in the Fontmap.

Adds a new Fontmap for VAX/VMS with DECWindows/Motif.

Changes MakeHersheyFont so it takes the encoding as an additional
parameter, and changes the Hershey-Symbol font to use SymbolEncoding.

</pre><h3><a name="V2.6_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The !@*&amp;^%#@$ PCL drivers *still* didn't do the right thing
about vertical spacing: the &lt;ESC&gt;*p+&lt;n&gt;Y command works on all PCL 3,
4, and 5 printers *except* the LaserJet IIp.
	- The cdj driver used recursive macros (height, t_margin,
b_margin) that not all compilers handled correctly.
	- The djtc driver used some assignments including =*, which
some compilers dislike.
	- The S3 driver wouldn't compile correctly with the Watcom
compiler.
	- The makefile entry for the S3 driver was wrong.
	- The SuperVGA drivers returned an error, rather than using
the highest available resolution, if a too-high resolution was
requested.
	- The GIF driver produced an incorrect header for images
wider or taller than 32K pixels.
	- The GIF driver wasn't able to handle multi-page documents
correctly.
	- The margins on the DeskJet were still not correct.
	- Some ANSI C compilers rejected a complex expression in
gdevpccm.c.
	- Printer drivers didn't recover cleanly from problems in
opening the scratch files.
	- The BJ-10e driver used the same name `out' for a label and
a variable.
	- The SCO ODT compiler couldn't handle sizeof(ppdev-&gt;fname).
	- The Epson driver used the wrong value for ESC in the
initialization string.

Adds new drivers:
	- Drivers to produce MS Windows .BMP format output.
	- A new ATI Wonder display driver (800x600, 16 colors) and a
1024x768 mode for the existing driver.

Adds new user-contributed drivers:
	- A driver for the Tektronix 4693d color printer.  This carries a
university copyright.
	- A driver for the SPARCprinter.
	- A driver for the Canon BJ200 printer.
	- A driver for the IBM ProPrinter.
	- A driver for the DEC LJ250 printer, which has a
PaintJet-compatible mode.
	- A replacement driver for the Sony NWP533.
	- A driver that writes TIFF/F (Group 3 fax) files.  This carries
an external copyright.
	- A driver for the C.Itoh M8510 printer.
	- A driver for the Okidata MicroLine 182 9-pin dot-matrix printer.
	- A Hercules Graphics driver.
	- A driver for printers under MS Windows.
	- A driver for direct frame buffer addressing under SCO Unix
and Xenix and AT&amp;T SVR4.

Changes the get_bits driver procedure so it always reads a single
scan line, and optionally does not copy the data.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE.  However, this change does not affect
any existing printer driver, since these all go through intermediate
routines in gdevprn.c.

Changes gdevprn.h, and the relevant printer drivers, so that -DA4
will change the default paper size for any printer driver.

Allows the use of NULL or 0 for default procedures in the driver
procedure vector.

Adds an optional map_cmyk_color procedure to the driver procedure
vector.

Changes the Epson driver so that the minimum amount of white space
required to use a tab is an easily changed parameter.

Changes the BGI driver to use separate segments for the Borland
device drivers, to reduce the risk of overflowing a segment.

Adds an optimization option (normally enabled) to the PGM and PPM drivers
such that they revert to PBM or (for PPM) PGM if the page can be
represented that way.

Adds a new (optional) driver procedure to get the procedure vector
for external fonts.

Adds an argument to gp_open_printer to indicate whether the file should be
opened in binary or text mode.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.
However, this change does not affect any existing printer driver, since
these all go through intermediate routines in gdevprn.c.

Changes the LN03/LA50/LA75 driver so it uses a text record mode to open
the output file under VMS (by adding an argument to gp_open_printer to
indicate this.)

Allows (indeed, encourages) drivers to use far_data to declare the device
structure, primarily to avoid overflowing the 64K data segment under MS
Windows.  Changes the file output drivers and many of the printer drivers
to declare their device structures as far_data.

Replaces the AT&amp;T 3B1 driver with an updated version (from the same
contributor).

Changes the Epson BJ driver and the SPARCprinter driver so they align
the (0,0) point of the page with the physical corner of the paper
rather than with the origin of the printable area.

Removes the EIZO MDB-10 driver, since it caused complications for the
EGA and VGA drivers and is not a widely used device.

</pre><h3><a name="V2.6_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The entry for the copydevice operator in the operator table
was initialized incorrectly.
	- printobject and writeobject didn't handle nested arrays.
	- restore didn't properly close the current file (if
appropriate), causing an invalidaccess error.
	- buildfont required the presence of a valid, 4-element
FontBBox.  (The Red Books say it's required, but Adobe interpreters
don't require it; some DEC software generates a 3-element FontBBox.)
	- resourceforall had several bugs; it didn't do even
approximately the right thing.  There were quite a few other problems
with the implementation of resources.
	- setfont, makefont, and scalefont would accept a font with
no FID entry.
*	- Loading a .PFB font left the file open (until the next
restore or quit).
	- The default (null) font didn't include a PaintType entry,
which some PostScript files expected.
*	- The ASCIIHexDecode filter sometimes thought the underlying
stream was at EOF even when there was (at most one buffer's worth of)
data left.
	- iscan.c included &lt;ctype.h&gt; before std.h, causing type name
clashes on some systems.
*	- save and restore didn't handle the pointers in the graphics
state correctly; for example, the current font wasn't restored
properly.
	- Binary object sequences at the top interpreter level didn't
get executed immediately.
	- On high-resolution devices, the default transfer function
converted almost-white grays to very light grays rather than white.
	- The `string' operator was checking the string length
against max_uint rather than max_ushort, which could cause invalid
lengths to be accepted.
*	- deviceinfo caused a stackunderflow error.
*	- idiv could give incorrect results for quotients or
remainders that didn't fit in 24 bits.
*	- The ASCII85Encode filter padded trailing bytes with 1's
rather than 0's.
*	- The ASCII85Decode filter had a typo that produced incorrect
results if there were exactly 2 trailing bytes.
	- findlibfile didn't push a copy of the file name if it was
the name of a special (%) file.
	- setduplexmode was not defined in statusdict, causing
/undefined errors from some poorly designed input files.
*	- The CCITTFaxDecode filter had several bugs in 2-D decoding.
*	- The ASCII85Decode filter didn't read ahead to detect EOD if
it fell precisely on a buffer boundary.
	- If a file mentioned on the command line redefined `start',
Ghostscript would run the new definition rather than the built-in one
after processing all the files on the command line.
	- The SCO ODT compiler couldn't handle the conditionals in the
ngetc (iscan.c) and sgetc* (stream.h) macros.
	- makefont and scalefont didn't cache the PostScript dictionaries
for scaled fonts.
	- Changing the elements of the Encoding of a font dynamically
didn't take effect if the character was already cached.
	- makefont and scalefont didn't add the (undocumented) OrigFont
and ScaleMatrix entries to the new font.
*	- findfont insisted that the font name be a string or a name.
	- filenameforall could cause an incorrect transfer of control
if no files matched the pattern.
*	- ISOLatin1Encoding had hyphen instead of minus at code 45.
	- restore didn't reset saved_cbot and saved_ctop correctly;
as a result, some freed blocks could get abandoned rather than put on
the free list.
	- Some numerical constants in zarith.c assumed that longs
occupied 32 bits.

Implements additional Level 2 features:
	- %device%file names (only the "os" device is provided).
	- &lt;~ ~&gt; for ASCII-85 strings.
	- Binary error messages.
	- BuildGlyph.
	- CCITTFaxDecode filter entries EndOfBlock, Rows, and
	(undocumented) FirstBitLowOrder.
	- {set/current}{color/colorspace/overprint/colorrendering/
	blackgeneration/undercolorremoval}.  (See below under library
	for limitations.)
	- Decode for the dictionary form of image.
	- File access modes a, r/w/a+.
	- Font entries CDevProc, Metrics2, and WMode.
	- Font operators cshow, findencoding, rootfont, and
	setcachedevice2.
	- glyphshow (emulated with PostScript code).
	- languagelevel.
	- realtime.
	- setbbox.
	- (Subset of) system and user parameters.
	- xshow, yshow, and xyshow.
	- XUIDs for fonts.

Moves the installation of systemdict and the initial allocation of
globaldict (if relevant) and userdict from gs_init.ps to iinit.c.

Makes Level 2 features dynamically selectable through the
.setlanguagelevel operator; disables all Level 2 features
(specifically including automatic dictionary expansion) unless the
level2 feature is included and active.

Adds the .knownget operator for speeding up system procedures.

Renames the type1addpath operator as .type1addpath; adds an optional
left side bearing argument; changes it so it does not do the
setcachedevice, fill, or stroke, but does do a moveto for the
character width.  Changes Type1BuildChar appropriately.  (All this is
needed to make WMode work.)

Removes the .setmetrics operator, which is no longer needed.

* Changes the meaning of the user_errors argument to gs_run_file and
gs_run_string so that -1 means always return on an error, 0 means
only return on an error not within a `stopped'.

Adds all the necessary checks and operators for local/global VM, but
doesn't actually implement local/global mode.

Changes setcachedevice back so that it requires 4 numbers on the
stack rather than a 4-element array.  (It was changed to be the other
way in release 2.0, but that was because I didn't realize that fonts
had to have an executable FontBBox, and some of the Ghostscript fonts
didn't.)

Changes all the filter operators from .filterxxx to .filter_xxx, and
removes the need to enumerate them in gs_init.ps.

Adds .oserrno and .oserrorstring operators for getting the last OS
error (in the current context).

Changes gs_finit similarly to gp_exit.  Adds gs_exit_with_code that
takes both an exit status and a Ghostscript error code.

Changes the name of name.h to iname.h.

Adds support for the `interrupt' error (but doesn't provide any standard
way of generating one, other than through the gp_check_interrupts polling
function).

Adds copyright to systemdict.

Changes the spot halftone screen to an elliptical screen supplied by
Berthold K. P. Horn.

Adds a check that the first token in gs_init.ps is an integer.  In
conjunction with other code in gs_init.ps, this should catch all attempts
to run Ghostscript with a gs_init.ps that doesn't match the executable.

Changes all relevant occurrences of sizeof to size_of in order to
work with the buggy SVR4.2 C compiler.

Changes gp_exit so it is passed both the Ghostscript error code and
the exit status code as arguments.  This is backward-compatible for
all but the pickiest compilers.

Adds a call on gp_check_interrupts() after fwrite calls in the stream
machinery.  This prevents lengthy console output from locking out
other programs.

Changes a couple of occurrences of op_def_ptr in iinit.c to work around a
`const' bug in Sun's SC1.0 compiler.

Adds a special hack in the 'where' operator to work around a bug in Aldus
Freehand 2.x.

Changes all empty argument lists from () to (void), which is the ANSI
C syntax.

Adds a hack to ignore ^[ and ^D^[ tokens, to work around the prologue
and epilogue emitted by the MS Windows LaserJet IV driver.

Defines the processcolors operator, which should not be needed, but
is required because of bugs in Lotus 1-2-3 and Adobe PhotoShop.

Changes the allocator (ialloc) to fill all allocated and/or freed
blocks with a marker if gs_alloc_debug is set, as gs_malloc and
gs_free already do.

</pre><h3><a name="V2.6_Library"></a>Library</h3><pre>
Fixes bugs:
	- 16-bit memory devices stored the bytes of each pixel in the
wrong order.
	- copy_mono did the wrong thing when copying 1 source chunk
to 2 destination chunks with polarity inverted.  (This probably
didn't affect any actual uses of Ghostscript.)
*	- The compile-time check for ints being 2 or 4 bytes used the
#error directive, which most compilers don't recognize.
	- arc and arcn didn't do the right thing for degenerate
(single-point) arcs, or for arcs drawn in the "wrong" direction that
were multiples of 360 degrees.
	- charpath did the wrong thing with Type 3 fonts.
	- copyscanlines gave an error if the buffer was too large.
	- The copy_mono procedure (used for text and halftones) for
2- and 4-bit-per-pixel memory and printer devices incorrectly
incremented the destination pointer after every pixel, instead of
only after every byte.
	- The fill_rectangle procedure (used for graphics) for 2- and
4-bit-per-pixel memory and printer devices, if given any color other
than all 0's or all 1's, multiplied the X coordinate and width by 2
or 4, thereby filling the wrong area.
	- The use of 'data' in both gs_type1_data and gs_font upset
the VMS compiler.
	- The `Flex' feature wasn't implemented for Type 1 fonts,
which caused serious errors in rendering some fonts that use it.
(Unfortunately, some Adobe fonts violate the specification, so we had
to implement Flex to always use a curve.)
*	- Stem width adjustment was too eager, producing very strange
effects on small characters with tight curves (a curve point could
get snapped to the other side of the open area).
	- The allocator didn't align structures adequately on
machines where sizeof(long) or sizeof(char *) was 8 bytes.
	- The test for IEEE floating point gave an incorrect
(negative) result on machines where sizeof(long) was 8 bytes.
	- genarch.c assumed that the result of subtracting two
pointers was an int, leading to a garbage arch.h file on systems
where this was false.
*	- The Type 1 font interpreter incorrectly reset the adjusted
path position to be the same as the unadjusted path position whenever
it returned control to the client (in particular, for callothersubr),
leading to discontinuities and distortions in the character shapes.
*	- Accented characters in Type 1 fonts often misplaced the
accent to the left.
	- gsmisc.c wouldn't compile on machines with 64-bit pointers,
because _pad was 0, and ANSI compilers don't accept 0-length arrays.
	- pathforall got confused if the client procedures modified
the path.
	- The command list file representation limited X and Y
coordinates to 15 bits.
*	- stroke could produce spikes or other garbage for mitered
joins as a result of stroke adjustment.
	- The params_size field of the null device was wrong, so
scaling the null device produced unpredictable results.

Changes monobit memory devices to always store data big-endian.  This
eliminates byte-swapping, at the cost of slightly slower rendering.

Removes the memswab* routines, since they are no longer needed.

Implements gs_cshow_[n_]init, which provides support for cshow, and
gs_xyshow_[n_]init, which provides support for {x,y,xy}show.

Adds an optional left side bearing argument to gs_type1_interpret.

Changes gs_type1_interpret so it does not do a setcachedevice, fill,
or stroke, but only appends the character outline to the path
(including a moveto for the character width.)

Removes gs_setmetrics, which is no longer needed.

Implements gs_setcachedevice2, which provides support for
setcachedevice2.

Speeds up gsave/grestore by allocating, deallocating, and copying as
much as possible of the graphics state in a single operation.

Implements gs_{set/current}{color/colorspace/overprint/colorrendering/
blackgeneration/undercolorremoval}.  Device, indexed (with table, not
with procedure), CIE, and (substituted) separation colors are
supported; some of the setup code for patterns is also present.

Increases the size of temporary file names in gdevprn.h from 30
characters to 60.

Changes the character cache to be allocated dynamically in chunks.

Splits gxcache.c into gxccache.c (fast "hit" code) and gxccman.c (all
other code).

Changes all occurrences of sizeof to size_of in order to work with the
buggy SVR4.2 C compiler.

Adds a new concept of "external fonts", which allow a driver to
substitute its own fonts for the ones obtained through the normal
font machinery.

Changes all empty argument lists from () to (void), which is the ANSI
C syntax.

</pre>

<hr>

<h2><a name="Version2.5.2"></a>Version 2.5.2 (9/20/92)</h2>

<p>This is yet another bug fix release to (finally!) get the PCL drivers
working again.

<h3><a name="V2.5.2_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The comment in devs.mak for cdjcolor said it used 8 bits
per pixel, rather than the correct 24.

Adds gsbj/dj/lj/lp and gslp.ps to the installed files on Unix
systems.

Removes dps.dev and level2.dev from the standard configurations on
all platforms, since the presence of the setcolor operator was
causing the output of some common applications to fail.

</pre>

<h3><a name="V2.5.2_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- font2c produced invalid output for any font that didn't use
StandardEncoding or ISOLatin1Encoding.

</pre>

<h3><a name="V2.5.2_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- gp_sysv.c required an extern long timezone.

</pre>

<h3><a name="V2.5.2_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The PCL drivers were *still* doing the wrong thing about
zeroing the seed row for Mode 3 compression.
	- Setting the resolution with -r didn't work under Windows.
	- The Windows driver got a stack overflow if it was ever
asked to display a bit image wider than 32 pixels.
	- The Tseng driver didn't sense the model (ET3000 vs. ET4000)
correctly.

Adds the eps9high device to the standard MS-DOS makefiles.

</pre>

<h3><a name="V2.5.2_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- gs_run_string used gs_user_errors (a global) rather than
user_errors (its argument) to control error handling.  (This does not
affect normal operation of Ghostscript, only use as a server.)
	- eexec popped the top element of the dictionary stack
afterwards even if the encrypted code had pushed something onto it.
This caused problems for some badly written PostScript code.
	- The printed form of real numbers didn't always include a
decimal point, causing compatibility problems.

Makes -s and -d work for device properties.

Increases the cache limit on large-memory systems.

Adds a check to ensure that the revision of gs_init.ps matches that
of the interpreter.

Adds the .knownget operator.

</pre><h3><a name="V2.5.2_Library"></a>Library</h3><pre>
Fixes bugs:
	- The raster computation in clist_render_init, and the
computation of state_size in clist_open, didn't widen an operand to
long, leading to possibly incorrect operation for 24-bit-per-pixel
printers on MS-DOS systems.
	- The flatness was set too large for Type 1 characters,
leading to visible straight edges instead of curves at large sizes.
	- Type 1 fonts that contained out-of-range coordinates would
produce garbled output.  (This was not a problem with the standard
Ghostscript fonts, or with Adobe Type Manager fonts.)
	- gschar0.c wouldn't compile, because it referred to a
non-existing structure member penum-&gt;chr.  (This had no effect on
Ghostscript's operation.)
	- The curve flattener required line segments to be no more
than 8 x the flatness in length, leading to an enormous number of
segments.
	- pathforall would cause an addressing fault if the path
consisted of only a moveto.

Refactors some header files so that std.h is always included before
any system header file that might include sys/types.h.

Adds logic for removing top and bottom blank rows in cached
characters.  (This is the beginning of compression for the cache.)

Changes the arguments of memswab2/4 from char * to byte *, for more
accurate type conformance.

</pre>

<h2><a name="Version2.5.1"></a>Version 2.5.1 (9/11/92)</h2>

<p>This is the usual bug fix re-release.

<h3><a name="V2.5.1_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The makefile rules for compiled fonts had a circular
dependency.
	- `make begin' didn't work properly on all platforms.

Ensures that all batch files end with a newline.  (The absence of the
newline was confusing the GNU diff program.)

Documents the fact that the -dASCIIOUT switch no longer exists.

</pre><h3><a name="V2.5.1_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- pstoppm didn't `bind' its internal procedures.
	- grestoreall would undo the output device selected by
pstoppm.

Changes the utilities for reading and writing Type 1 character
outlines so they can work with stack representations as well as
arrays.

Removes the pfbtogs.ps, phonbook.ps, and showpbm.ps utilities from
the distribution.

Adds a gslj utility to parallel gslp and gsdj.

</pre><h3><a name="V2.5.1_Platforms"></a>Platforms</h3>

<pre>
Adds the DeskJet 500C drivers (cdeskjet/cdj*) to the MS-DOS / Borland
C++, MS-DOS / Watcom C/386, and MS-Windows configurations.

Removes the PCX file driver from the MS Windows executable, because
the static data segment exceeded 64K.

Makes some changes in the Unix System V platform file (gp_sysv.c) and
in time_.h and unixtail.mak to accommodate the 3B1.

</pre><h3><a name="V2.5.1_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
	- The Charter-Italic font was named bchi.pfa rather than
bchri.pfa.
	- The Cyrillic fonts (cyr.gsf, cyri.gsf) were omitted from
the fileset.
	- Ghostscript incorrectly assumed that all Type 1 fonts had a
FontInfo dictionary.
	- .loadfont used false PFBDecode, so a few .PFB fonts would
get errors because the first eexec byte would be whitespace.

Changes font2c and its supporting code so that compiled fonts are
location-independent.

</pre><h3><a name="V2.5.1_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The margins for the H-P printers were still wrong.
	- The H-P drivers accidentally cleared the compression seed
row when switching compression modes.
	- Some of the H-P drivers used the wrong control codes for
skipping blank lines.

Adds user-supported drivers for the AT&amp;T 3B1 console device, and for
the NEC P6+ printer.

Updates the SunView driver with a new version supplied by a(nother)
user.

Changes the X Windows driver so the Ghostscript window doesn't get
input focus.

Changes the common code for the printer drivers so that if it can
allocate a full bitmap but there isn't at least a minimum amount of
memory left afterwards, it switches to banding.

Changes the Windows driver so it handles devices with more than 8
bits per pixel.  (We haven't been able to test this.)

Adds a read-only PageCount device property (for printer devices
only).

Changes all Aladdin-supported drivers to clip drawing requests to the
((0,0), (width,height)) rectangle of device space.

</pre><h3><a name="V2.5.1_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- Closing a NullEncode filter always gave an ioerror.
	- If a single-character name occurred 1 character before the
end of an input buffer, the character would be doubled.
	- The procedures in gs_statd.ps didn't use "bind".
	- Setting the page size didn't work properly with devices
with rotated coordinate systems.
	- If an error occurred, and the error object wasn't the last
element of its procedure, the interpreter would re-execute the error
object after running the error handler.
	- Memory devices didn't get resized if HWSize was changed,
leading to out-of-bounds memory accesses.

Moves revision and revisiondate from gs_init.ps to iinit.c.  Adds a
-v switch that just prints these out.

Arranges things so that if Ghostscript is reading from a pipe (`-'
switch on the command line) and encounters an error, it exits with
status 1 rather than 0.

Changes the interpreter interface so the caller explicitly passes a
pointer for storing an error object.

</pre><h3><a name="V2.5.1_Library"></a>Library</h3><pre>
Fixes bugs:
	- The automatic adjustment of the scaling for variant paper
sizes caused the image to get expanded when it should have been
contracted, and vice versa.
	- The curve flattener insisted that each line segment be no
more than 2 x the flatness in length, leading to an enormous number
of segments even when not necessary for accuracy.
	- flattenpath and strokepath discarded a trailing moveto.
	- strokepath treated "0-width" lines as really having a width
of zero, rather than one pixel.
	- Buffered devices weren't closed and reopened if the amount
of buffer space was changed.
	- stroke used the line cap at the beginning of each subpath
even if the subpath was closed.

Removes the requirement that the clipping rectangle fall in the
non-negative quadrant of device space.  (This was causing problems
for Ghostview, but removing it required adding the extra clipping
step to the drawing routines in the drivers.)

</pre>

<h2><a name="Version2.5"></a>Version 2.5 (8/18/92)</h2>

<p>This version adds Type 1 hinting, CCITTFax encoding and decoding, and
Microsoft Windows support, as well as the usual minor improvements
and bug fixes.

<h3><a name="V2.5_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- GSIMPATH, SLZWD, and SLZWE were omitted from the VMS
makefiles, and GSIM2OUT was not removed.
	- landscap.ps messed up the current path.

Adds new switches:
	-dSAFER disables file writing and directory modification.
	-dESTACKPRINT causes errors to print the execution stack with
== instead of =.
	-sOutputFile=&lt;string&gt; replaces -sOUTPUTFILE (which is still
recognized) for setting the output file or pipe for the default
(printer) device.
	-sPAPERSIZE=&lt;sizename&gt; initializes the paper size.
	-dBufferSpace=&lt;number&gt; sets the buffer size for the default
(printer) device.

For Unix systems, changes the directories in GS_LIB_DEFAULT from
`pwd` to $(gsdatadir), i.e., normally $(datadir)/ghostscript, where
datadir is normally /usr/local/lib.

Adds a note in the header file to the effect that the X Windows
driver expects to find header files in $(XINCLUDE)/X11, not in
$(XINCLUDE).

Changes -q so it defines QUIET as true instead of null (so it can be
used in the middle of the command line as well as at the beginning).

Renames the history.doc file as NEWS.

</pre>

<h3><a name="V2.5_Utilities"></a>Utilities</h3>

<h3><a name="V2.5_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- The stack size was not getting increased on the Watcom
platform.

Removes "b" from the scratch file opening modes in gp_unix.c and
(conditionally) in gdevprn.c, to pacify the DECstation Ultrix system.

Adds a makefile (bcwin.mak) and a platform file (gp_mswin.c) for
Microsoft Windows.

On MS-DOS platforms (including Windows), uses the TEMP environment
variable to designate the directory for scratch files.

Changes std.h so that the VMS C compiler uses function prototypes and
'const'.

Changes the VMS cc makefile so it doesn't use ansi2knr.

</pre><h3><a name="V2.5_Fonts"></a>Fonts</h3><pre>
Fixes bugs:
	- findfont left an extra entry on the stack if it couldn't
find the default font.

Renames bchi, ncri, and puti as bchri, ncrri, and putri, to conform
with the naming scheme for other fonts.

Adds $(CCFLAGS) to the command line used for compiling fonts.

Converts the .pfa fonts (CharterBT, IBM Courier, and Utopia) to .gsf,
by removing eexec encryption and also removing some mysterious
unmapped characters from Courier.  This makes these fonts work with
DISKFONTS.

Changes the implementation of compiled fonts so they are read-only
and sharable (no external references).  (They are, however, not
position-independent.)

Provides a way to use compiled fonts on platforms that limit the
number of characters in an identifier.

Adds public-domain Cyrillic and Cyrillic-Italic fonts.

Adds a 'userdict begin' to .loadfont, because Type 3 fonts produced
by Fontographer expect a writable dictionary on the top of the stack.

Changes definefont for Type 1 fonts to insert UnderlinePosition and
UnderlineThickness entries in FontInfo if they are absent, because
many word processors incorrectly assume these entries are present.

</pre><h3><a name="V2.5_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The documentation in use.doc said that the densities for
9-pin Epson printers were 60x60 to 240x60, rather than 60x72 to
240x72.
	- gdevprn.c smashed one byte beyond the end of the string
given as the OutputFile device property.
	- The X11 driver used XVisualIDFromVisual, which is not
defined in X11R3.
	- The SunView driver modified the input data, which was
declared as const.
	- The LaserJet IIP and III drivers shifted the page 185
pixels to the left and 0.25" down, because the initialization string
was incorrect.
	- The PCX driver wrote 16-bit values using the byte ordering
of the platform, rather than always LSB first.
	- For vertical spacing, the LaserJet and DeskJet drivers used
a command that spaces N/300", rather than N scan lines, but gave it a
parameter in scan lines.
	- The VESA driver didn't allocate a full 256-byte buffer for
reading the mode information from the BIOS, causing the stack to get
smashed by newer VESA implementations.
	- The VESA driver didn't use the scan line length returned by
the BIOS, causing garbage output for some cards and some resolutions.
	- The generic printer driver didn't free the bitmap when
closing the device, if it fit entirely in memory.
	- The PaintJet driver allocated its data areas on the stack
instead of with gs_malloc.
	- The generic printer driver didn't attempt to increase the
buffer size if it was too small.
	- The band list driver didn't split large bitmaps properly,
leading to garbled characters at high resolutions.
	- The GIF and PCX drivers used a color map that often turned
gray colors into non-grays.

Changes the default put_props procedure so that if the device is
open, setting HWSize and/or HWResolution closes the device and
reopens it.

Adds a driver for Microsoft Windows 3.n.

Updates the 'cdj' and 'dj500c' DeskJet 500C drivers with new versions.
(This are user-contributed drivers.)

Changes gdev_prn_put_props so OutputFile can be changed dynamically.

Updates the DEC LN03 driver to also handle the LA50 and LA75.  (This
is a user-contributed driver with a FSF copyright.)

Changes the LaserJet/DeskJet driver so that -DA4 in the makefile
makes A4 paper the default.  The driver now also sends an appropriate
page size selection command to the printer if the printer supports it.

Changes all the Aladdin-supported drivers to return appropriate error
codes rather than -1.

Adds a driver for the S3 86C911, a PC graphics accelerator used in
the popular Diamond Stealth board.  This is the first driver that
uploads character bitmaps to a device; others will probably follow.

Adds user-supplied code to the Epson driver so it will do triple
passes on 9-pin printers for higher resolution.

Adds user-supplied code for the PaintJet XL to the PaintJet driver.

</pre><h3><a name="V2.5_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- zdps1.c didn't include alloc.h.
	- On 32-bit systems, if maxlength of a dictionary was less
than the actual allocated space, length could become larger than
maxlength.
	- flushfile didn't actually flush data when reading.
	- The ASCII85Decode filter signalled EOF prematurely.
	- The scanner interpreted .3D.glorp as the number 0.3, rather
than as a name.
	- Closing a file freed the stream structure, creating
dangling references if there were other file objects pointing to the
same stream.
	- eexec called handleerror if an error occurred, instead of
letting the error propagate to an enclosing stopped.
	- gs.h made perror illegal, instead of defining it in terms
of strerror.
	- One-character names weren't being allocated at
initialization, so they could be left dangling after a restore.
	- Internal gsaves (i.e., the ones in show and setcachedevice)
didn't also save istate, so setfont inside a BuildChar procedure
might cause the font outside to get changed.
	- The allocator incorrectly freed objects in the current
chunk that were older than the current save.
	- mark was just an object, rather than an operator, so 'bind'
didn't bind it.  (This is theoretically a problem for null, true, and
false also, but even more unlikely to be a problem in practice.)
	- packed_get didn't cast packed integers to int, so negative
integer elements of packed arrays came out wrong.
	- quit just did a gs_exit, instead of returning to the driver
in an orderly way.
	- Because check_type_access checked for errors in the wrong
order, sometimes type errors were reported as access errors.
	- eq didn't check for stack underflow.
	- Some of the stream_procs structures weren't properly
declared const, leading to link errors on VMS.

Implements currentcolor, currentcolorspace, setcolor, and
setcolorspace (for DeviceGray, DeviceRGB, and DeviceCMYK only).

Implements the dictionary form of image and imagemask.  All the pairs
in the Decode array must be the same; Interpolate is ignored.  The
only supported color spaces are DeviceGray, DeviceRGB, and
DeviceCMYK.

Implements files as allowable sources for the image operators.

Removes the index field from the name structure, moving it to the
'size' field of name refs.

Changes the unread/sungetc operation to require that the character be
the same as the last one read from the file.

Adds fflush calls to some debugging printout routines, because Unix
sometimes buffers terminal output.

Implements the CCITTFaxEncode and CCITTFaxDecode filters.  Implements
the general case of the SubFileDecode filter.

Changes definefont to treat a UniqueID of 0 as equivalent to no
UniqueID, because Fontographer output apparently often violates the
specification in this way.

Changes the default printer screen from 32.5 to 46 cells/inch.  (The
old value was appropriate for a hand-rotated cell with two spots in
it.)

Changes the utility routines to allow an integral real wherever an
integer parameter is expected in a dictionary, because Fontographer
produces fonts that violate the Adobe specification in this way.

Adds a `dosio' feature that provides direct access to memory and to
I/O ports under MS-DOS.  (This feature is not included in the
standard executables, of course.)

Changes the default character cache limit to a 1/4" x 1/4" character
at the default resolution, rather than basing it on the preallocated
cache size.

Removes support for t_color objects, which haven't actually been used
for several releases.

Implements setcmykcolor and currentcmykcolor as operators, so they
will interact properly with setcolorspace and currentcolorspace.

Changes the name of the file.h header file to files.h, to work around
a bug in the VMS header library.

Adds command line switches @file (to treat file as more command line,
to get around the DOS 128-character command line limit) and -ffile
(so one can specify file names that begin with - or @).

Changes the PFBDecode filter so it takes an additional boolean that
says whether or not to convert binary packets to hex.  (Conversion to
hex and back to binary accounted for a substantial amount of the time
required to load .PFB fonts.)

Splits off `copydevice' as a separate operator again.

</pre><h3><a name="V2.5_Library"></a>Library</h3><pre>
Fixes bugs:
	- In the VMS environment, string_.h used its own prototypes
for the str... and mem... functions instead of &lt;string.h&gt;
	- gx_alloc_char_bits declared cdsize as long, but didn't
shorten it when passing it to shorten_cached_char.
	- Stroking didn't suppress fattening of the lines.
	- kshow didn't update the cached CTM information in the show
enumerator when returning from the callout, so further characters
could get drawn in the wrong place.
	- When a memory device returned its initial matrix, it
smashed the padding fields, which contained the interpreter's type
information.
	- setcachedevice didn't set the initial matrix in the cache
memory device.
	- image_set_rgb (in the image operators) didn't do a
gx_color_from_rgb, so in principle one could sometimes get incorrect
colors in an image.
	- The decision about whether or not to cache a character
bitmap incorrectly compared the character size against cmax rather
than cdata_size.
	- show didn't reset the in_cachedevice flag in the graphics
state, so characters rendered by a recursive show were never cached.
	- clip and eoclip didn't release the intermediate flattened
clip path, causing memory to be lost.
	- The tile_diff routine didn't handle the case of two
identical tiles properly; this produced garbage in the band list
file.
	- stringwidth didn't round the character origin to an
integral pixel; this interacted badly with hinting, causing
improperly hinted characters to wind up in the cache.
	- Bitmaps (including characters) were displaced, as well as
being clipped, if they intersected the top of a clipping region.
	- In gxclist and gdevmem1, the raster computation (although
not the result) could overflow an int on 16-bit machines.

Implements decoding (sample mapping) for image and imagemask.

Implements hinting for Type 1 fonts, based on (but not copying) the
algorithms from the X11R5 tape.

Changes curve rasterizing to use sampling, rather than recursive
subdivision, for characters.  This produces noticeably better output.
Speed penalty for non-cached characters is less than 10% at display
resolutions, up to 50% for 300 dpi printers.

Implements gs_setcmykcolor and gs_currentcmykcolor.  These are
semi-fake, since they simply convert the color to and from RGB, but
the former does set the current color space properly.

Changes clipping regions so they use the any-part-of-pixel rule
rather than the center-of-pixel rule.  This helps avoid dropouts when
using very small regions.

Implements stroke adjustment.

</pre>

<hr>

<h2><a name="Version2.4.2"></a>Version 2.4.2 (5/8/92)</h2>

<p>
This is another quick release.  It finally fixes rotated halftone
screens, and cleans up a few minor problems from 2.4.1.

<p>
This release is being distributed only to beta testers and commercial
licensees, since I don't want to be distracted from working on 2.5.

<h3><a name="V2.4.2_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- UTRACE still appeared in the VMS makefiles.
	- The support files (*.bat, *.doc, *.gsf, *.ps, Fontmap,
COPYING, README) weren't included in the MS-DOS tar file.
	- The Unix install script didn't install landscap.ps.

Replaces the type1imagepath operator with PostScript code (impath.ps,
type1ops.ps) based on the new .imagepath operator.

Renames LICENSE as COPYING.

</pre><h3><a name="V2.4.2_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- pcharstr.ps had an occurrence of Subrs rather than /Subrs,
causing it to not print the Subrs, or to get an error if there were
none.
	- font2c.ps didn't get the const declarations for string
dictionaries quite right.
	- The missing newline at the end of gsbj.bat confused GNU
diff.
	- ansi2knr would go into an infinite loop if a statement
exceeded its internal buffer size.
	- Compiled fonts would get processed by ansi2knr, which
messed them up.

</pre><h3><a name="V2.4.2_Platforms"></a>Platforms</h3><pre>
Fixes bugs:
	- Ghostscript didn't supply equivalents for rename and
gettimeofday, which some System V platforms lack.
	- The missing newline at the end of gp_dosfb.c confused GNU
diff.

Changes the Borland makefiles so that stack checking is only enabled
if DEBUG or TDEBUG is set.

</pre><h3><a name="V2.4.2_Fonts"></a>Fonts</h3>

<pre>
Changes the names of the Utopia fonts from utrg/utb/utbi/uti to
putr/putb/putbi/puti, for consistency with the rest of the font names.
Changes cour/courb/courbi/couri to ncrr/ncrb/ncrbi/ncri likewise.

Replaces the Charter fonts with the CharterBT fonts donated by
Bitstream to the X11R5 distribution.

Adds font aliasing capability to Fontmap.  Replaces
Courier-[Bold]Oblique and ZapfChancery-MediumItalic by aliases.

Changes the FontBBox of the Hershey fonts to be an executable, rather
than a literal, array.

</pre><h3><a name="V2.4.2_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The GIF driver omitted a `private' on the definition of
gif_print_page.
	- The GIF driver wrote 16-bit values using the byte ordering
of the platform, rather than always LSB first.
	- George Cameron's DeskJet 500C driver had an incorrect
control sequence for skipping blank lines.

Adds 'const' in many places, including the tile and bitmap arguments
of the tile_rectangle, copy_mono, and copy_color driver routines.
THIS IS A DRIVER INTERFACE CHANGE.  (Printer drivers are not
affected, since they don't implement these routines.)

Adds a driver for the Trident TVGA.

</pre><h3><a name="V2.4.2_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- alloc_free sometimes incorrectly chose to put an unaligned
block in an old segment on a freelist.
	- The default undercolor removal function returned its
argument rather than returning 0.

Adds NullEncode and SubFileDecode to the standard filters, since
bdftops uses the latter.

Adds RunLengthEncode and RunLengthDecode to the optional filters.

Removes the type1imagepath operator.  (It is still available as
PostScript code, impath.ps.)  Replaces it with a simpler outline
tracing operator .imagepath.

Adds 'const' in many places.

Makes fileposition (but not setfileposition) legal for NullEncode
filters.

Changes the default transfer function for high-resolution devices
from the identity function to the square root function.

Moves array_get from zgeneric.c to iutil.c.

Changes uses of fopen to add a "b" to the access mode, rather than
relying on the _fmode global variable on MS-DOS platforms.

Allows use of the -Z switch even when gsmain.c wasn't compiled with
-DDEBUG, since other modules might have been.

Reorganizes gs.c and gsmain.c so that the latter can be used in
server environments.

Replaces all uses of stdin/out/err with gs_stdin/out/err.

Makes the number of permanent entries on the dictionary stack a
parameter, to allow inserting globaldict in the future.

Changes BlueShift in the Type 1 font Private dictionary to allow real
numbers.  (This differs from the Adobe specification, but at least
one commercial font has a real number for BlueShift.)

</pre><h3><a name="V2.4.2_Library"></a>Library</h3><pre>
Fixes bugs:
	- The doubling check in init_ht (gxht.c) still sometimes
thought there was enough room to double the tile when there actually
wasn't.
	- Rotated halftone screens didn't work.
	- gxarith.h used #ifdef vax, rather than #if
!arch_floats_are_IEEE, to test whether IEEE floats were being used.
	- pathforall didn't report a trailing moveto.

Replaces gs_type1imagepath with gs_imagepath.

Allows sOUTPUTFILE=-, meaning output to stdout.

Adds 'const' in many places.

Replaces all uses of stdin/out/err with gs_stdin/out/err.

</pre>

<h2><a name="Version2.4.1"></a>Version 2.4.1 (4/21/92)</h2>

<p>This is a quick release to fix minor problems discovered in 2.4, and
to add a few improvements that didn't quite make it into 2.4.  It
also adds GIF and PCX file support.

<h3><a name="V2.4.1_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- Some makefile dependencies, and the ccgs script, caused trouble
for parallel versions of `make'.
	- Compiling genarch with -O with gcc on the RS/6000 produced a
buggy executable.

Fixes some minor problems in make.doc.

Adds DEVICE_DEVS2..5 to handle long device lists.

Removes the need to set GS_RUN_EXE when using the Watcom compiler on
MS-DOS systems.

Gets rid of gs_ccfnt.ps, merging its function into gs_fonts.ps.

Gets rid of gconfig.ps; this information is now compiled in gconfig.c.

</pre><h3><a name="V2.4.1_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- The palette for pstoppm in 8-bit mode didn't contain all 8
primary colors.
	- font2c used just values_ to mean &amp;values_[0]; some compilers
couldn't handle this.

Makes font2c insert `const' in many appropriate places.

</pre><h3><a name="V2.4.1_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The SunView driver had not been updated properly for 2.4 and was
pretty thoroughly broken.
	- None of the printer drivers worked properly with the Watcom
compiler, because stdprn was doing \n -&gt; \r\n substitution.
	- If the generic printer driver couldn't allocate the requested
size command list buffer, it gave up rather than trying to allocate a
smaller buffer.
	- The SuperVGA drivers (except for the VESA driver) didn't
work with the Watcom compiler, because a couple of places in the
drivers weren't truncating the offset of "segmented" pointers
properly.
	- Some of the H-P used &lt;esc&gt;*b#Y rather than &lt;esc&gt;*p+#Y for
vertical positioning; this apparently is wrong, at least for the
LJIIp.

Removes the dependence of the X Windows driver on Xt, Xext, and Xmu.  As a
result, Ghostscript will not install a standard colormap itself, but it
will use one if one is already installed.

Adds a set of drivers for Portable Bitmap, Graymap, and Pixmap file
formats.

Adds drivers for monochrome, EGA/VGA-style, and SuperVGA-style PCX
file formats.

Adds drivers for monochrome and 256-color GIF file formats.

</pre><h3><a name="V2.4.1_Fonts"></a>Fonts</h3><pre>
Adds ZapfChancery-MediumItalic as a copy of ZapfChancery-Oblique.

</pre><h3><a name="V2.4.1_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- A value with l_new set could 'escape' to save level 0 on a
stack; if stored, it prevented the slot from being saved and restored
properly.
	- 16#7fffffff + 1 gave the floating point equivalent of -2^31, not
2^31.
	- The PFBDecode filter computed the packet length incorrectly if
the 0x8000-bit of the length was set.
	- 5-byte numbers in Type 1 CharStrings complained of a rangecheck
if they exceeded 16 bits, rather than if they exceeded the integer part of
a fixed.
	- (, ), and \ appearing in file name arguments in the command
line did not work properly.

Adds 'const' in many places.

Changes the random number generator to be the same as the one used in
Level 2 PostScript (as reported by Ed Taft on comp.lang.postscript).

Exits with code 1 rather than code 0 on an unrecoverable error detected at
the PostScript level.

Makes dictionaries expand automatically when they fill up.

Adds gp_exit to complement gp_init.

Changes dictionaries to always allocate a power of 2 entries on
32-bit machines.  Changes the name table to allocate indices
scattered, so dictionary lookup doesn't have to do a multiply to
scramble the index.

Changes the handling of currentfile to do "shallow binding" so stack
searching is almost never required.

</pre><h3><a name="V2.4.1_Library"></a>Library</h3><pre>
Fixes bugs:
	- arc and arcn got a numeric exception if the radius was zero.
	- The undocumented 15 opcode in Type 1 fonts wasn't ignored.
	- PaintType 3 wasn't allowed.  (It isn't clear what it should
mean; we treat it as equivalent to 0.)
	- The VAX/VMS C compiler was generating incorrect code for the
chi_bits and cmask macros in gdevmem, producing incorrect output.
	- If the result of the slow algorithm for intersecting clipping
paths was a rectangle, the wrong thing happened (cbox didn't get set).
	- gx_path_is_rectangle didn't recognize open rectangles.
	- clist_change_tile didn't check properly whether the tile
size had changed, so changing the screen could produce invalid band
files.
	- The image operators did the wrong thing in the 1-for-1
case, interleaving N bytes of data with 7*N bytes of garbage.
	- stroke sometimes handled bevel and miter joins wrong in
reflected coordinate systems.
	- init_ht checked incorrectly whether there was enough room
to Y-replicate tiles, so sometimes it did it when it shouldn't have.
	- stroke sometimes thought lines were thin when they weren't.

Adds 'const' in many places.

Adds support for 2- and 4-bit-per-pixel memory devices.

</pre>

<h2><a name="Version2.4"></a>Version 2.4 (3/25/92)</h2>

<p>This is a major release that adds SuperVGA support, support for
Metrics,
settable device properties, and incremental font loading.  It also
includes important performance improvements, based on rewrites of some key
algorithms, and quite a few new Level 2 / Display PostScript facilities.

<h3><a name="V2.4_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The rule for compiling gconfig.c didn't include the -I switches.
	- .bat files were being distributed with a \n line terminator
rather than \r\n.
	- A CLOSE MODULE_LIST was needed after END_COMPILE: in the VMS
command files.
	- Unix systems couldn't handle multiple drivers with overlapping
sets of files.
	- -s&lt;name&gt; defined &lt;name&gt; as a null, rather than as an empty string.

Adds gconfig.ps to the list of needed configuration files.

Changes the way that the makefile handles nested .h files, so that it
doesn't have to `touch' them.

Adds the loadallfonts procedure to gs_fonts.ps.

Changes the standard DOS configuration to include VGA, EGA, VESA, Epson,
BubbleJet, and H-P printer drivers.

Renames ghost.mak as gs.mak, and gdevs.mak as devs.mak.

Adds a USE_ASM flag so that one can build a DOS version of Ghostscript
without having an assembler.

Splits off common code from the two MS-DOS makefiles into tccommon.mak.

Replaces the COPYING and LICENSE files with a new LICENSE file containing
version 2 of the GNU General Public License.

Removes DEVICES and DEVICE_OBJS from the makefiles, since they are no
longer needed.

Adds a GS_DEVICE environment variable to supply a default device name if
desired.

Adds ansihead.mak and unix-ansi.mak, to parallel [g]cc-head.mak and
unix-[g]cc.mak, for other ANSI C compilers.

Changes the way that optional features are defined in the makefiles, so
that they actually work.

Adds support for the Watcom C/386 compiler.

Allows # in the command line as equivalent to =, to compensate for
brain-damaged MS-DOS shell.

Adds -sOUTPUTFILE= to set the output file or pipe.

Adds -dWRITESYSTEMDICT to leave systemdict writable.

</pre><h3><a name="V2.4_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- pcharstr.ps insisted on having Subrs be present in the font.
	- pcharstr.ps decoded negative numbers between -108 and -1131
incorrectly.
	- pfbtogs.ps didn't handle packets longer than 64K correctly.

Changes the bdftops utility so that it makes entries for UnderlinePosition
and UnderlineThickness in FontInfo, and so that it always records a
FullName (the FontName if no other is provided).

Changes the name of the pfbtops utility to pfbtogs, because groff already
includes a program called pfbtops.

Adds the gslp utility for doing "line printing" of text files, similar to
enscript + lpr.

Adds a new variable DITHERPPI that enables a different dither pattern,
claimed to be better for printers.

Adds the font2c utility for compiling Type 1 fonts into C, so they can be
linked into an executable rather than loaded dynamically.

</pre><h3><a name="V2.4_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- gdev_prn_copy_scan_lines was erroneously masking the last byte
of data even on color printers, as was paintjet_print_page.
	- The TruFax driver had a couple of compilation errors, since it
hadn't been compiled in a while.
	- The BGI driver sometimes didn't consult BGIPATH when looking for
.BGI files.
	- initclip did the wrong thing with memory devices.
	- The BGI driver didn't look in BGIDIR for .BGI files.
	- The Epson driver didn't set the right margin properly with
ESC+Q.
	- The BJ-10e driver was badly broken.
	- gdev_prn_open/close_printer didn't reset the command list file,
so it was taking quadratic time to print multi-page documents.

Adds color to the SunView driver.

Adds selectable resolution (75, 100, 150, or 300 DPI) to the
DeskJet/LaserJet driver.

Changes gssetdev so that drivers can specify special libraries to be
loaded, as well as object files.

Adds a driver for VESA-compliant SuperVGA displays.  This driver handles
all resolutions from 640 x 400 up to 1280 x 1024, in 256-color mode.  The
default is VGA resolution (640 x 480).

Adds a driver for the ATI Wonder SuperVGA card, and for SuperVGA cards
using the Tseng Labs ET3000 or ET4000 chip such as the STB VGA EM-16 and
the Orchid ProDesigner II (256-color modes only).

Adds a driver for Trident and Tseng Labs SuperVGA cards in 800 x 600,
16-color modes (for cards with only 256K of memory).

Adds user-contributed drivers for the Ricoh 4081, DEC LN03, Canon LBP-8II,
and H-P DeskJet 500C printers.

Adds Tim Theisen's Ghostview changes to the X11 driver.

MAKES NON-BACKWARD-COMPATIBLE CHANGES TO THE DRIVER PROCEDURE INTERFACE as
follows:

	- Changes map_rgb_color and map_color_rgb to always work in a
	    16-bit color value space, rather than a space defined by the
	    maximum number of distinct colors provided by the device.

	- Adds an argument to the output_page procedure to indicate
	    whether the procedure is being called for copypage or
	    showpage, and a num_copies argument.

	- Adds a gx_bitmap_id to the copy_ and tile_ procedures, so that
	    drivers can cache bitmaps in the server or device if they want
	    to.

	- Removes fill_trapezoid and tile_trapezoid.

	- Adds a new get_bits procedure for reading the bits back from the
	    driver buffer (when possible), replacing copy_scan_lines.
	    This procedure takes a new argument describing padding and
	    byte swapping, and returns a different value from
	    copy_scan_lines.

	- Adds get_props and put_props procedures for accessing arbitrary
	    additional properties of devices.  The interface is quite
	    complex, but provides a great deal of flexibility.

See drivers.doc for details.

Changes gdev_mem_bytes_per_scan_line to gdev_prn_bytes_per_scan_line.

Adds a user-contributed driver for DigiBoard, Inc.'s fax software.

</pre><h3><a name="V2.4_Fonts"></a>Fonts</h3>

<pre>
Changes Type1BuildChar so it uses the information from the Metrics
dictionary in the font, if Metrics is present.

Changes findfont (.loadfont) so it recognizes .PFB fonts and can load them
directly.  Also changes .loadfont to disable packing temporarily, because
some fonts rely on procedures being writable (!).

</pre><h3><a name="V2.4_Interpreter"></a>Interpreter</h3><pre>
Fixes bugs:
	- The hypot function is not available on some Unix systems.
	- Ghostscript didn't flush and close files when exiting.
	- In statusdict, the /margins procedure used .leftmargin, but
/setmargins used .lmargin.
	- An out-of-range putinterval would simply do nothing, rather than
reporting an error.
	- If an attempt to allocate a block larger than the allocator's
chunk size (20K) failed, the allocator would erroneously think it had
succeeded.
	- The bind operator made the top-level procedure read-only, as
well as interior procedures.
	- gs.c copied 1 extra character for the value of strings defined
on the command line with -s...=, which could smash the first byte of the
next object in memory.
	- copying a dictionary erroneously required the maxlength of the
destination to be greater than or equal to the maxlength of the source,
rather than the length of the source.
	- undef didn't correctly decide when to mark a deleted entry as
deleted vs. free; as a result, some keys couldn't be looked up properly
after an undef.
	- type1encrypt and type1decrypt didn't set the size of the result
properly.
	- cvi and cvr didn't allow leading or trailing whitespace in
strings.
	- cvs didn't cause an error if the destination string was too
short.
	- Many operators didn't check correctly for stack underflow (off
by 1).
	- `for' used reals, rather than integers, if the limit was a real,
even if the initial value and increment were integers.
	- `restore' didn't properly invalidate copies of the save object
being restored from; `save dup restore restore' would crash.
	- `restore' sometimes didn't undo stores into matrices that were
stored into by operators.  (The identity matrix always had l_new set.)
	- readline gave a rangecheck if the input line exactly filled the
string.
	- `--' as the last switch on the command line caused a crash
rather than an error message.
	- On MS-DOS systems, filenameforall didn't handle patterns with a
drive or directory specifier properly.
	- stroke sometimes called gz_draw_line_fixed even if the line went
outside the clipping box by 1 pixel.

Changes the loop that binds procedure "operators" to entirely disable the
handling of the typecheck error, rather than to use stopped.  This cuts
initialization time significantly, and also eliminates about 35K of wasted
space (for saving the stacks).

Changes the version "operator" so it returns 47.0.  Adds "revision" to
define the Ghostscript version # x 100.

Adds gscurrentresolution and gssetresolution procedures for getting and
setting the device resolution.

Adds -r&lt;res&gt; and -r&lt;xres&gt;x&lt;yres&gt; as command line options for setting
device resolution.

Adds a facility for incrementally loading the individual CharStrings of a
Ghostscript font from the disk.  This can save a lot of memory, at the
expense of slower rendering.  (It is intended primarily for MS-DOS
systems.)

Changes findlibfile to return the name of the file that was actually
opened, as well as the file itself, when the operation succeeds.

Changes the name of the main entry to the interpreter from interpret to
gs_interpret, because of a conflict with a Data General library procedure.

Adds the .setmetrics operator to set the metrics for the current
character for Type 1 fonts.

Adds more LaserWriter-specific entries to statusdict.

Gives names to all the internal `operators', so they will print out
reasonably when an error occurs.

Extends the status operator to accept a string and return file
information, as defined for Level 2 PostScript.

Adds the filter operator and some specific filters: ASCII85Encode,
ASCII85Decode, ASCIIHexEncode, ASCIIHexDecode, eexecDecode, NullEncode,
PFBDecode, and the null case of SubFileDecode.

Extends the scanner to recognize the Level 2 &lt;&lt; and &gt;&gt; tokens.

Adds a facility for extracting the text strings from a PostScript file and
writing them out in a simple format (selected by -dASCIIOUT, implemented
by gs_2asc.ps).

Implements all of the remaining Display PostScript facilities that are
also in Level 2 (i.e., everything in section A.1.3 of the PostScript
Language Reference Manual, Second Edition, that is not also in section
A.1.2).  The virtual memory operations are all stubs; the new halftone
options are not fully implemented.

Changes makeimagedevice to use a string of gray or RGB values, rather than
an array of color objects, to specify the palette.  Removes
currentgscolor and setgscolor from the interpreter, but leaves t_color
objects in, since they may be useful later.

Adds getdeviceprops and putdeviceprops for manipulating device properties.
Currently defined properties for all devices: InitialMatrix, HWResolution,
HWSize, Name.  Currently defined properties for printers: BufferSpace,
MaxBitmap, OutputFile.  OutputFile allows |command for piping on Unix
systems.

Removes deviceparams and makedevice.  Adds devicedefaultmatrix.

Implements reversepath.

Makes copy work on devices.

MS-DOS specific
- - - - - - - -

Fixes bugs:
	- iutilasm.asm wouldn't assemble with newer versions of MASM if
CPU_TYPE was set to 286 or above.
	- CPU_TYPE=386 didn't properly substitute the faster
multiply/divide routines under Turbo C++ or Borland C++, only under the
original Turbo C.

</pre><h3><a name="V2.4_Library"></a>Library</h3><pre>
Fixes bugs:
	- A curve whose first and last points were the same wouldn't get
drawn at all.
	- A bug in the Turbo C++ compiler generated bad code when shifting
a long right by 1 bit.
	- If stroking a dashed line ever encountered a segment that was
completely blank, Ghostscript would indirect through a null pointer.
	- arc and arcn gave an error if the radius was negative.
	- stroke always used the general algorithm, even if the line was
guaranteed to be thin.
	- arc and arcn erroneously reduced the angles mod 360.
	- Very large or negative 32-bit numbers in Type 1 fonts didn't
work properly on MS-DOS systems (the ff0000 bits got set to zero).
	- Color printer devices rendering entirely in memory only
allocated a monochrome-sized bitmap.
	- clip and eoclip didn't intersect the paths properly in the
general case.
	- charpath erroneously rounded the current point to an integral
value, causing characters to be spaced improperly.
	- The definition of max_color_param got some compilers confused.
	- charpath always used quadratic time and space, and dropped all
but the last character when used with a Type 3 font.
	- Stroking a path with a 180 degree angle would incorrectly miter
instead of beveling.
	- Type 1 fonts used the current flatness for curves, which could
produce bad (and inconsistent) results.
	- Stroking a degenerate line segment produced incorrect results.

Changes the character cache to use the UniqueID as the key, when
available, instead of the font pointer.  This dramatically improves
performance when fonts are getting removed and reloaded because of page
isolation with save/restore.

Removes some unnecessary casts to (float) from gsmatrix.c and gscoord.c.

Changes the Type 1 interpreter so that it rounds line and curve endpoints
to the center of the nearest half-pixel, and omits null line segments.
This both speeds up rendering at small sizes and improves output quality.

Changes gs_deviceparams to return resolution as well as extent; changes
gs_makedevice to accept resolution as well as extent.

Replaces the algorithm for approximating circular arcs with curves with a
more accurate one.

Changes gs_point and gs_rect to use doubles rather than floats.

Adds gs_setmetrics, for overriding Type 1 font metrics for the current
character.

Changes clipping to use lists of rectangles rather than path intersection.
 This makes a big difference when clipping bitmaps (including characters).

Changes the character cache to discard entries incrementally, rather than
clearing the entire cache when it fills up.

Changes the implementation of transfer functions to use a cached map,
built when the transfer function is set.  This makes transfer functions
work properly in all situations, including images.

Defines a .quit operator that takes an exit code, and redefines quit in
terms of it.

Adds support for 16-bit-per-pixel devices in gdevmem.

Adds gs_copydevice and gs_deviceinitialmatrix; removes gs_deviceparams and
gs_makedevice.

Changes setscreen to ensure that the cell is always at least 4x4 pixels in
size.

</pre>

<h2><a name="Version2.3"></a>Version 2.3 (8/28/91)</h2>

<p>This is a minor release to fix two bugs and add the PaintJet driver,
which
didn't make it into 2.2.

<h3><a name="V2.3_Utilities"></a>Utilities</h3><pre>
Changes the pstoppm utility so it counts pages correctly even in the
presence of arbitrary saves and restores.

</pre><h3><a name="V2.3_Drivers"></a>Drivers</h3><pre>
Adds a new, "supported" PaintJet driver.

Changes the Epson driver to use ESC+D rather than ESC+\ for horizontal
positioning, since many printers don't support the latter.

Adds horizontal double-density (two-pass) printing to the Epson driver, so
it can do 240 x 60 and 360 x 180 densities.  (Vertical double density is
not supported yet.)

</pre>

<hr>

<h2><a name="Version2.2"></a>Version 2.2 (6/1/91)</h2>

<p>
The purpose of this release is to add save/restore, and a few
miscellaneous Level 2 P*stScr*pt features such as undef.  It also includes
major improvements in graphics quality and in handling of high-resolution
printers.

<h3><a name="V2.2_Procedures"></a>Procedures</h3><pre>
Changes the version numbering to M.mpp rather than M.m.p, so that
`version' can be a real number for those programs that insist on it.

Renames ghost.ps as gs_init.ps, gfonts.ps as gs_fonts.ps, and statusd.ps
as gs_statd.ps.  The initialization files now all are named gs_*.ps.

Renames gdevs.{c,h,tl} as gconfig.{c,h,tl}.

Changes the relevant makefiles and command files so that a single build
can contain several drivers that share code, e.g., the Epson driver and
the DeskJet driver.

Changes gs_init.ps so it relies on an external gconfig.ps file rather than
making a specific test for the presence of Level 2 features.

Adds an entry for uglyr.gsf to the makefile.

Removes the distinction between CCA and CCNA, since most of the files now
contain constructs that require non-ANSI compilation on MS-DOS platforms.

Adds a `man' page for the ansi2knr utility.

Changes the documentation (use.doc) to show how to use -sDEVICE=&lt;device&gt;,
or the selectdevice procedure, to select devices by name.

Adds DEVICE_DEVS to the makefiles (analogous to DEVICES and DEVICE_OBJS).
This finally makes the make procedure fully automatic.

Adds the name of the initialization file (gs_init.ps) as a
platform-specific makefile parameter, GS_INIT.

Removes the test program gt.{c,tr} from the fileset, since it is not
useful to users.

Moves the Symbol encoding vector to a separate file (symbol_e.ps), from
which it is loaded when first used.

Changes the error handler so it can handle errors that occur while reading
the initialization files.

Extends ansi2knr so it can handle `void' and `...' in parameter lists.

Adds quit.ps to the set of installed files.

MS-DOS-specific changes
- - - - - - - - - - - -

Adds the VGA and BGI drivers to the standard MS-DOS configuration, and
makes VGA the default.

Adds a `+' and a newline at the end of gs.tr, to avoid problems with file
transfer programs or editors that add a newline at the end of files.

Changes the name of msdos.mak to turboc.mak, and creates a new tbcplus.mak
makefile for use with Turbo C++ and Borland C++.

Changes the extension of the loader response files from .tl to .tr.

Changes the default search path from c:/ghost and c:/ghost/fonts to c:/gs
and c:/gs/fonts.

Changes the directory separator from `|' back to ';', since it appears
that DOS can handle a ; in a command line if it is prefixed with \.

Unix-specific changes
- - - - - - - - - - -

Changes the uses of install in unixtail.mak so they only install a single
file at a time, which is all that the standard Unix install allows.

Removes the duplicate files (README/readme, LICENSE/license,
COPYING/copying, Fontmap/fontmap).

Changes the ld flags from LDPLAT to LDFLAGS.

Adds XCFLAGS and XLDFLAGS.  These are concatenated with CFLAGS and LDFLAGS
respectively.  The intention is that they be set from the `make' command
line if desired.

VMS-specific changes
- - - - - - - - - -

Repairs the omission of ZPACKED from the VMS build lists.

</pre>

<h3><a name="V2.2_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The SunView driver produced semi-garbage on little-endian
platforms (Sun-386i) because it didn't swap the bit order.
	- The X driver would dump core if it couldn't open the display and
the DISPLAY environment variable wasn't set.
	- The X driver relied on white = 0, black = ones in a couple of
places;
	- The X driver would return an error, instead of clipping, if
asked to display outside the window.
	- The X driver would create inappropriately sized windows, because
it believed the server's report of the screen resolution.

Adds Fran Taylor's Private Eye driver to gdevs.mak and the fileset (not
supported by Aladdin Enterprises).

Adds Neil Ostroff's TruFax driver to gdevs.mak and the fileset (not
supported by Aladdin Enterprises).

Makes the scratch file template for the printer drivers a per-platform
quantity (gp_scratch_file_name_template).  Puts the default scratch files
for Unix in /usr/tmp rather than /tmp.

Changes the SunView driver to prevent the Ghostscript window from being
destroyed (which badly confuses the interpreter).

Extends the Epson driver to handle a variety of print densities in both X
and Y, to handle 24-pin as well as 8-pin graphics, and to allow optional
specification of default density in the makefile (gdevs.mak).

Refactors the printer drivers so that a single driver handles both DeskJet
and LaserJet.  Adds LaserJet drivers that use the new compression modes on
the LJ IId/IIp and LJ III.

Changes all the printer drivers to use band lists rather than bitmap
paging as the buffering method.  (The individual drivers need only a
one-line change to replace mem_copy_scan_lines with
gdev_prn_copy_scan_lines with a different argument.)

Adds the halftone phase as additional arguments to tile_rectangle and
tile_trapezoid.

Adds an entirely new and much simpler PaintJet driver, using the new band
list interface.

Adds margin information to the device structure.  This is currently only
relevant for printer devices.

Adds BGIPATH and BGIUSER environment variables, allowing additional
control of the BGI driver.

Changes the x/y_pixels_per_inch member of the device structure from int to
float.

</pre>

<h3><a name="V2.2_Fonts"></a>Fonts</h3>

<pre>
Patches gs_fonts.ps so definefont will add an isFixedPitch entry to
FontInfo if there isn't one there.

Removes the old "type 7 path" encoding code from gs_fonts.ps.

Changes bdftops so it puts isFixedWidth and ItalicAngle entries in the
FontInfo dictionary of the fonts it creates, since some P*stScr*pt
programs rely on this.

Changes bdftops so it synthesizes as many missing characters as possible
out of the ones that are there (in particular: synthesizes accents out of
punctuation marks, and accented characters using seac.)  The results
aren't all that good, but they're a lot better than having characters
missing out of the font.

</pre><h3><a name="V2.2_Utilities"></a>Utilities</h3><pre>
Adds a pfbtops utility for converting .PFB fonts to standard Ghostscript
fonts.

Fixes bugs:
	- ps2image didn't reset things properly between pages for
multi-page documents.

</pre><h3><a name="V2.2_Interpreter"></a>Interpreter</h3><pre>
Makes Ghostscript recognize `-' alone as meaning that it should read from
standard input as though it were a file.  This allows Ghostscript to
accept a pipe as input.

Fixes bugs:
	- seac in type1addpath used the current font's encoding, not
StandardEncoding.
	- type1decryptfile (eexec) didn't recognize binary (as opposed to
hex) representation.
	- Mentioning a name whose value was a no-access object caused an
invalidaccess error.
	- There was a bogus definition of `run' in zfile.c.
	- The interpreter didn't handle end-of-file on stdin properly.
	- Real numbers with an 'e' or 'E' but no decimal point were not
recognized.
	- On MS-DOS systems, inside strings, \ followed by a newline was
not discarded properly.
	- On MS-DOS systems, the long unsigned divide routine sometimes
gave incorrect answers.  Among other things, this caused alternate-radix
numbers sometimes to crash the interpreter.
	- cvrs didn't do the right thing about reals or negative integers.
	- .echo.mode was being reset with def instead of store, and was
defined in systemdict rather than userdict.
	- setgray and settransfer didn't interact properly.
	- 16#80000000 was being interpreted as a signed integer (and
converted to a real) rather than an unsigned one.
	- atan returned 0 sometimes when it should have returned 180.
	- currentcmykcolor was defined wrong.

Removes the filename operator, since no standard Ghostscript code used it,
and it caused problems with some P*stScr*pt files.

Implements new operators: filenameforall, selectfont (as a procedure),
stringmatch, undef.

Adds new standard procedures: selectdevice.

For MS-DOS, requires that the operand and execution stacks be located in
the data segment, and uses short pointers to address them.  This produces
significantly smaller and faster code.  (These changes are not visible to
users or library clients.)

Changes the assignment of attribute bits, and adds new bits for
save/restore and the garbage collector.  Changes many of the macros in
store.h to support save/restore.  (These changes are not visible to users
or library clients.)  Implements save and restore.

Moves type names from gs_init.ps to ghost.h and ztype.c.

Moves error names from gs_init.ps to errors.h and iinit.c.

Introduces gp.h as a documented interface to the platform-specific files.

Adds the -- switch, which allows Ghostscript programs to take arguments
from the command line.

Changes many uses of the name `name' to something else, to avoid upsetting
the Microsoft C compiler.

Really implements packed arrays -- they took the same amount of space as
ordinary arrays in previous versions.

Changes exitserver in serverdict so that it just clears the stacks.  (This
isn't the correct fix, but it will do as a workaround.)

Makes many miscellaneous small changes to pacify various compilers.

Changes gs_fonts.ps so that when "quiet" mode is selected (-q switch),
Ghostscript doesn't print anything when loading fonts or when substituting
for undefined characters.

Defines the name consisting of just a control-D as a no-op, because some
P*stScr*pt-generating applications put control-Ds in their output.

Implements halftone phase (sethalftonephase and currenthalftonephase
operators).

Removes the -E switch, since it is no longer useful.

Changes the -w and -h switches to a single -g (geometry) switch, with
usage -g&lt;width&gt;x&lt;height&gt;.  Makes the -h switch, and a new -? switch, print
usage help.

Implements correct handling of stack overflow errors (makes an array out
of the contents of the overflowing stack, and resets the stack, before
invoking the error handler).

Adds t_oparray (`operators' defined as procedures) and the makeoperator
operator.  This is so that programs like the Distillery that rely on all
operators being bound by `bind' will work properly.

Adds a new NOPAUSE flag to suppress the prompt and pause at copypage and
showpage.

</pre><h3><a name="V2.2_Library"></a>Library</h3><pre>
Fixes bugs:
	- gs_type1_interpret didn't store the encryption state or the skip
count before returning to let the client handle a seac or an endchar in
the middle of a seac.
	- The definition of the Type 1 operator ce_testadd was based on
wrong information; the operator takes only 2 operands and does something
unknown.
	- mem_true24_copy_mono wasn't incrementing the destination pointer
if the color was transparent, leading to garbled characters.
	- gx_lookup_fm_pair would sometimes look at one entry beyond the
end of the cached font/matrix pair area.  (This probably had no practical
effect.)
	- gs_type1_interpret didn't save the current point when returning
to the client for a callothersubr, causing some characters to be rendered
displaced (such as some of the chess pieces in chess.ps).
	- gs_setgray, gs_sethsbcolor, gs_setrgbcolor, gs_setflat, and
gs_setlinewidth gave errors for out-of-range operands rather than forcing
them into range.
	- Transfer functions were not actually supported.
	- The area fill algorithm failed on certain complex paths.
	- The current point was sometimes defined when a BuildChar
procedure was called.
	- Stroking a degenerate line didn't display anything for round
caps or joins.
	- If the ends of a curve had exactly the same X coordinate, the
curve sometimes wouldn't be displayed.
	- Very thin lines that went outside the clipping region would
sometimes be displayed as dashed, or not at all.
	- The translation in a FontMatrix was ignored.
	- Very wide, shallow lines would color extraneous pixels when
using bevel or miter joins.
	- Dashed lines didn't join properly at the beginning of a closed
path.
	- 0-degree arcs didn't add the appropriate line (possibly
degenerate) to the path.
	- gs_type1_interpret didn't reset the callsubr stack when starting
the base character of a seac, which caused confusion if the accent's
endchar fell inside a Subr.
	- Non-monochrome memory memory devices weren't checking the
arguments of the drawing procedures properly.
	- The initial clipping rectangle for memory devices was being
computed wrong.
	- Null devices had a semi-infinite clipping rectangle instead of
an empty one.
	- gs_setlinewidth was treating negative arguments as zero, instead
of taking the absolute value.
	- imagemask with a dithered color used a solid color rather than
the dithered one.

Tweaks the area fill and image rendering algorithms to be a little more
liberal with paint when being used to render characters.

Changes the name of the 8-bit mapped color memory device from
mem_mapped_color_device to mem_mapped8_color_device.

Changes the memory devices so that on little-endian platforms, they can
store the bytes within a word in either order.  (Little-endian order
allows efficient 32-bit updating, big-endian is required when displaying
or writing to a printer or a file.)

Implements halftone phase.

Replaces the trapezoid fill algorithm with a much more accurate one
inspired by a contribution from Paul Haeberli.  This also changes the
graphics convention back to filling only pixels whose center falls within
the region to be filled.

Changes the character cache to allocate headers and bits contiguously out
of a single ring buffer.

Changes gs_imagemask and gs_imagemask_init to take a thickness adjustment
parameter.

Changes gs_setcachedevice and gs_setcharwidth to take the graphics state
as a parameter.

Renames gx_device_memory_bitmap_size as gdev_mem_bitmap_size,
mem_copy_scan_lines as gdev_mem_copy_scan_lines, and
mem_bytes_per_scan_line as gdev_mem_bytes_per_scan_line.

</pre>

<hr>

<h2><a name="Version2.1.1"></a>Version 2.1.1 (1/15/91)</h2>

<p>This is a sub-release distributed to fix a few early bugs in 2.1,
just in
time for the new GNU master tape.

<h3><a name="V2.1.1_Build_procedures"></a>Build procedures</h3><pre>
Removes all of the (undebugged) Level 2 code from the fileset, as well as
the (unused) file gdevvga.c.

Changes the tar file so that the files are stored in the directory
gs&lt;version&gt; rather than simply gs, e.g., gs211.

</pre><h3><a name="V2.1.1_Interpreter"></a>Interpreter</h3><pre>
Changes the scanner so that \ is recognized within strings regardless of
whether the scanner is reading from a string or from a file.  This is
compatible with newer P*stScr*pt interpreters, and with the newer
P*stSc*pt language specification, but not with the older specification in
the original PostScript Language Reference Manual.

</pre><h3><a name="V2.1.1_Drivers"></a>Drivers</h3><pre>
Fixes the max_value macro in gdevmem.c so that compilers won't complain
about a left shift by 32.

Adds 'byte' to the list of types that gdevx.c must sidestep because header
files use them.

</pre><h3><a name="V2.1.1_Library"></a>Library</h3><pre>
Changes the computation of penum-&gt;unpack in gsimage.c so as not to upset
compilers that don't treat procedures and pointers to procedures as
compatible types for conditional expressions.

</pre>
<h2><a name="Version2.1"></a>Version 2.1 (12/31/90)</h2>

<p>This is primarily a bug fix release to clean up problems in 2.0.  It
also implements a first cut at the new color operators.

<h3><a name="V2.1_Build_procedures"></a>Build procedures</h3><pre>
Changes the separator for multiple directories in MS-DOS from ';' to '|',
since there is no way to include a ';' in a command line.

Adds &lt;dir&gt;/fonts to the default search path, where &lt;dir&gt; is c:/ghost for
MS-DOS systems and `pwd` for Unix systems.

Adds new documentation describing how to direct output to the printer.

Changes the PROCTYPE and USE8087 options in MSDOS.MAK to CPU_TYPE and
FPU_TYPE.  The latter now indicates the type of FPU to generate code for,
if any.

</pre>

<h3><a name="V2.1_Drivers"></a>Drivers</h3>

<pre>
Adds a driver for the Canon BubbleJet BJ10e.

Modifies the EGA driver to handle (non-standard) frame buffers larger than
64K.  Adds drivers for the VGA and for the EIZO MDB-10 (a 1024 x 768 frame
buffer).

Changes the X driver so that it clips to the window dimensions, rather
than reporting an error.

Notes that the H-P LaserJet driver, like the DeskJet driver, works under
Unix as well as MS-DOS.

Adds support for 120 X DPI mode, and for the LQ-1500, to the Epson driver.

</pre><h3><a name="V2.1_Fonts"></a>Fonts</h3><pre>
Fixes bugs in bdftops:
	- It was using /UniqueId instead of /UniqueID as the key for the
font unique ID.  This effectively disabled the font cache.
	- The definition for .notdef was bogus -- an invalid CharString.

Changes ghost.ps and gfonts.ps so that NullFont is the initial font,
rather than Ugly.

Arranges things so that when attempting a font substitution, if the
default font is not found, NullFont is used instead.

Extends bdftops so that if certain easily synthesized characters are
missing from a font, it will attempt to synthesize them using available
characters.

</pre><h3><a name="V2.1_Interpreter"></a>Interpreter</h3><pre>
Extends the -T switch to allow specifying a printf template for the
arguments of the procedure being traced.

Fixes bugs:
	- /0 was interpreted as equivalent to 0 (a number) rather than a
literal name.
	- packedarray was defined as being like array, instead of like
array followed by astore.
	- Many minor and harmless type mismatches (and a couple of very
minor genuine bugs) were upsetting the Apollo C compiler.
	- exp was incorrectly failing in certain cases with a negative
first argument.
	- copyscanlines incorrectly required at least 4 elements on the
operand stack, although it correctly only used the top 3.
	- readhexstring incorrectly read 1 byte even if the string length
was zero.
	- Not every place that expected an array would accept a packed
array.
	- Very complex paths (and infrequently other things) could produce
a 'memory leak'.
	- / alone would skip following whitespace and gather following
characters, rather than creating an empty name.
	- ghost.ps left newerror defined as true in $error, which resulted
in an erroneous error report if a program executed a 'stop'.
	- The definition of exitserver in serverdict didn't clear the
stack.
	- currentfile returned an executable file, rather than a literal
one.
	- setfont for Type 1 fonts didn't check the UniqueID in the font
dictionary against the one in the font's Private dictionary.
	- A value stored in a dictionary under the key /xxx couldn't be
retrieved using the key (xxx), and vice versa.
	- charpath with a Type 1 font on a string containing a 'space'
would produce garbage (it released the parent path inappropriately).
	- bytesavailable did not work properly for terminal input.

Changes the interface to the memory allocator so that it always takes an
element size and an element count, like calloc instead of malloc (but note
that alloc does *not* clear just-allocated blocks).  Gets rid of the
special 'dynamic' allocation procedures.

Changes the random number operators to use a better implementation.

Changes the idiv operator so it will accept any numbers, not just
integers, as arguments.  (The PostScript manual doesn't allow this, but
implementations apparently do.)

Provides semi-fake but usable definitions for all of the color PostScript
extensions, including a real implementation of colorimage.

No longer uses the name 'null', which is apparently reserved by Microsoft
C.  Makes a number of other minor changes required to pacify the Microsoft
C compiler.

Implements %statementedit and %lineedit.  (%statementedit is equivalent to
%lineedit, which is wrong.)  Changes the interactive interpreter to use
%statementedit.

Changes the scanner to accept null, ctrl-K (vertical tab), and ctrl-L
(form feed) as whitespace.  Ctrl-L terminates a comment, null and ctrl-K
do not.

Allows a literal string as the 'proc' argument(s) for image, imagemask,
and colorimage.

Adds the following operators/procedures: arct, cleardictstack, deletefile,
renamefile.

Defines =print as a synonym for =, for the benefit of LaserPrep.

Implements non-zero PaintType for the show operators (but not for
charpath) for Type 1 fonts.

Adds the ISOLatin1Encoding encoding vector.

Renames currentcolor and setcolor as currentgscolor and setgscolor, to
avoid conflict with the Level 2 PostScript names.  Removes colorhsb,
colorrgb, hsbcolor, and rgbcolor.

</pre><h3><a name="V2.1_Library"></a>Library</h3><pre>
Fixes bugs:
	- In a couple of places, a 0 was being passed as a pointer
argument without casting, which confused the Microsoft C compiler.
	- Image devices were not recognized properly in debugging
configurations.
	- Inverted-color monochrome image devices were not recognized
properly.
	- Images that exactly fill the drawing area rendered very slowly,
because they erroneously used the general clipping algorithm.
	- Images that are 1-for-1 with the device were incorrectly scaled
by a factor of 8 in X.
	- Rounding artifacts sometimes caused characters to be unevenly
offset vertically by 1 pixel.
	- Type 1 fonts that used the Flex feature resulted in garbled
images.
	- The show operator routines would incorrectly fill or stroke a
path that existed at the time the show was started.
	- setscreen truncated the cell size instead of rounding, which
could produce off-by-1 anomalies.
	- stroke would sometimes produce garbage (or nothing at all) for
very narrow lines.
	- path filling would only color the pixels whose centers fell
inside the path: the Adobe specification requires coloring a pixel if any
part of it falls inside the path.

Changes the Epson printer driver so that it drives the printer directly
rather than writing to a file.

Changes pathbbox so that if the path is empty but there is a current
point, it returns a null rectangle at the current point.

Changes gs_image_init to take an additional parameter (after bps) giving
the number of samples per pixel (1, 3, or 4), and an indication of whether
the samples for each pixel are together or separated (-3 or -4).

Renames the gs_image_data and gs_imagemask_data procedures as gs_image and
gs_imagemask, and removes the old versions of the latter.

Adds gs_colorimage.

Replaces Snoopy's color dithering algorithm with one contributed by Paul
Haeberli.

Changes gs_setgray, gs_[set]hsbcolor, and gs_[set]rgbcolor so that they
coerce arguments outside the range [0..1] back into the range, instead of
signalling an error.

Makes a number of minor changes required to pacify the Microsoft C
compiler.

Changes gs_arcto so that if the last argument is a null pointer, the
tangent points are not returned.

Removes gs_type1addpath, which is not useful.  (Clients must call
gs_type1_init and gs_type1_interpret directly.)

Implements the 'seac' opcode for Type 1 fonts, allowing fonts with accented
characters to display properly.

Implements the undocumented 'testadd' opcode for Type 1 fonts, which is
used by some Adobe fonts.

Renames gs_currentcolor and gs_setcolor as gs_currentgscolor and
gs_setgscolor.  Removes gs_colorhsb, gs_colorrgb, gs_hsbcolor, and
gs_rgbcolor.

</pre>

<hr>

<h2><a name="Version2.0"></a>Version 2.0 (9/12/90)</h2>

<p>The main purpose of this release is to add fonts, support for
multiple
devices, and imaging into memory.  It also fixes a number of miscellaneous
bugs.  (Unfortunately, accurate records of the bugs fixed are not
available.)  The changes were so extensive that we chose to increment the
major version number.

<h3><a name="V2.0_Miscellaneous"></a>Miscellaneous</h3><pre>
Doesn't attempt to open the .MAP file on Unix systems.

Adds mention of statusd.ps to interp.doc.

Notes that Turbo C 2.0, not 1.5, is required for building the MS-DOS
version.

Adds a DEVICES= line to the makefile, and allows multiple devices.

Documents, in interp.doc, the X Windows resources that Ghostscript
recognizes.

Adds three PostScript masters to the fileset: chess.ps (+ cheq.ps),
golfer.ps, and escher.ps.

</pre><h3><a name="V2.0_Drivers"></a>Drivers</h3><pre>
Changes the names of all the device drivers.  See gdevs.mak for the
updated list.

Adds a (working) driver for SunView.

Adds drivers for the Sony NeWS frame buffer, and the Sony Microsystems
NWP533 printers.  These drivers were contributed by users, so we aren't
prepared to answer questions about them.

Adds a driver for the Borland Graphics Interface (BGI) for MS-DOS systems.
Note that to use this driver with a non-EGA/VGA display, you need a .BGI
file appropriate for your hardware.  (The Ghostscript executable includes
the EGA/VGA driver.)

Adds a driver for Epson printers.  The driver has only been tested on an
LX-800, and on an H-P DeskJet in FX-80 emulation mode, but may work on
other models.  The driver could be adapted to work on Unix systems, but as
distributed, it only works on MS-DOS systems.

Adds a driver for the Hewlett-Packard DeskJet printer.  The driver could
be adapted to work on Unix systems, but as distributed, it only works on
MS-DOS systems.

The X Windows driver no longer waits for the user to type a character
before bringing up the initial display.

Adds information to drivers.doc describing how to change the definition of
the device structure and procedure table.

Extends the tile_rectangle and tile_trapezoid driver procedures to
interpret color0 = color1 = gx_no_color_index as meaning that the tile is
actually colored, not a mask.

</pre><h3><a name="V2.0_Build_procedures"></a>Build procedures</h3><pre>
Changes the tar file so it puts everything in a directory called gs.

Removes the -ansi switch for gcc (this was causing problems with &lt;math.h&gt;
on some systems).

Changes LDPLAT to the string -X, which is appropriate for most Unix
systems (but not for SunOS 4.n).

Adds EXTRALIBS to the makefile, for specifying additional libraries to be
linked in.

Adds a 'clean' target for 'make', to get rid of all temporary files, the
binaries, and the executable.

Changes names of system-specific files from gp-xxx.c to gp_xxx.c.

Adds support for VMS (gp_vms.c and ghost.dcl).

Creates a new file gdevs.mak, and reorganizes the other makefiles, so that
the choice of which device driver(s) to include is isolated in a single
line in the platform-specific makefile.

Changes the standard MS-DOS makefile so it builds for 8088/86 (not 80386),
with neither -DNOPRIVATE nor -DDEBUG.

Changes the name of the MS-DOS makefile from dos-ega.mak to msdos.mak, and
the Unix makefiles from ux-[g]cc-x.mak to unix-[g]cc.mak.

Updates drivers.doc to describe how to add new drivers in gdevs.mak.

Removes gdevs.ps: the drivers are now responsible for specifying the size
of the imaging region.

</pre><h3><a name="V2.0_Interpreter"></a>Interpreter</h3><pre>
Adds a makefile macro GS_LIB_DEFAULT and an environment variable GS_LIB to
define a search path for the library (initialization and font) files, and
implements the -I switch for the same purpose (replacing -sLIB=, which was
never actually implemented).  See interp.doc for details.

No longer clears the operand stack between interactive inputs.  No longer
prints the contents of the operand stack after every input in debug mode.

Doesn't "eat" the character that the user types to proceed after a
showpage, unless it's an isolated &lt;return&gt;.

Changes the prompt so that it says
	GS&gt;
if the operand stack is empty, or
	GS&lt;n&gt;
if there are n &gt; 0 elements on the operand stack.

Adds -w and -h switches to the command line, equivalent to -dWIDTH= and
-dHEIGHT= except that they require numeric arguments.

Adds -q (quiet startup) switch to the command line, which suppresses some
initial messages and also has an effect equivalent to -dQUIET.

Fixes bugs:
	- = and == caused an error on some kinds of objects if the object
didn't have read access.
	- cvs didn't print operator names.
	- The definition of dynamic_begin in iscan.c caused the DEC VMS C
compiler to produce incorrect code.
	- mul didn't return a correct (real) result when multiplying a
very large integer by an integer that wasn't very large.
	- eq and ne didn't work on files, fonts, save objects, and some
operators.
	- The scanner would sometimes blow up on floating point numbers
beginning with a '.'.
	- flushfile didn't pop its argument from the stack.
	- put and putinterval would store into a packed array.
	- a few operators didn't check properly for stack underflow.
	- cvrs produced wrong output for radix values greater than 10.
	- The scanner would convert upper-case letters in alternate-radix
numbers wrong on Unix systems.
	- String comparisons other than equality often produced the wrong
result if the strings were of different lengths.
	- An ifelse as the last thing inside a forall would confuse the
execution stack.
	- There were some omitted casts and 'private' declarations that
made the GNU compiler unhappy.
	- There was a memory leak in the image[mask] operators that caused
516 bytes to be permanently lost each time one of them was used.
	- Quoted strings of length greater than 50 and less than 100 would
get mangled when being read in.
	- The scanner didn't consume the whitespace character following a
token, so programs that read data out of the program file could get
confused.
	- Under rare circumstances, an object of size between 249 and 255
bytes could get allocated on top of another object.

Allows bind to bind packed arrays, even though they aren't normally
writable.

Changes the length operator to allow a name as the argument.  (The
PostScript manual doesn't allow this, but implementations apparently do.)

Changes the setcachedevice operator to allow the bounding box to be
specified as a 4-element array instead of 4 scalars.  (The PostScript
manual doesn't allow this, but implementations apparently do.)

Removes a line from ghost.ps that accidentally disabled the font cache.

Implements memory devices (makeimagedevice, copyscanlines, and makedevice
for image devices).  makeimagedevice is implemented only for 1, 8, 24, and
32 bits per pixel.

Changes the deviceparams operator so it pushes a mark on the stack below
the parameters.  This is to allow for devices that have more than the
standard set of parameters.

Replaces defaultdevicename with two new operators, getdevice and
devicename.

Adds a flushpage operator that flushes any outstanding buffered output to
the screen.  This is not the same as copypage: on printers, copypage
actually prints a page, whereas flushpage may do nothing; on displays,
flushpage and copypage may both flush output to a server.

Adds an unread operator for pushing back a character into a file.

Adds a description of proposed grayimage and colorimage operators to
ghost.doc, even though they aren't implemented yet.

Changes the name of the currentfileposition operator to fileposition.

Removes the framedevice operator, since the new device operators supersede
it.

Adds a writeppmfile operator, for writing the contents of a memory device
to a ppm file.

Makes Ghostscript work even when the &gt;&gt; operator doesn't sign-extend
negative numbers.  (This has not been tested.)

Adds the Symbol encoding to ghost.ps.

Adds two new file-related operators, filename and findlibfile.  See
ghost.doc and interp.doc for details.

Adds type1encrypt and type1decrypt operators for manipulating Adobe Type 1
encoded fonts.

Changes the imagecharpath and addcharpath operators to type1imagepath and
type1addpath.  These operators now work with the Adobe Type 1 font
encoding.

Adds the type1decryptfile operator for reading Adobe Type 1 encrypted
fonts.

</pre><h3><a name="V2.0_Library"></a>Library</h3><pre>
Fixes bugs:
	- curveto and lineto didn't check for the current point being
defined.
	- stringwidth would fail if there was no current point.
	- There were omitted casts that made the GNU compiler unhappy.
	- Line caps and joins didn't always work.
	- Dashed lines didn't work at all.
	- If you read out the current matrix while inside a BuildChar
procedure, the result was garbage.
	- image[mask] would crash if you gave it a single string with more
than 64K-1 pixels (MS-DOS only).
	- Filling with a gray pattern sometimes wrote into pixels beyond
the right edge of the region (MS-DOS only).
	- The font cache would mistake fonts for each other if both fonts
had a default (unsupplied) "unique ID".
	- When a character was entered into the font cache for the first
time, sometimes it would display as garbage and/or displaced vertically
from its proper position.

Implements gs_makeimagedevice, gs_copyscanlines, gs_getdevice,
gs_devicename, gs_flushpage, gs_writeppmfile, gs_type1encrypt,
gs_type1decrypt, gs_type1imagepath, and gs_type1addpath procedures
corresponding to the new operators in the interpreter (see preceding
section).

Changes [gs_]setdevice so that it does an erasepage when it first opens
the device.

Changes definition of gx_device structure as follows.  NOTE: THIS AFFECTS
ALL DRIVERS.

	- Removes bits_from_MSB (which wasn't actually used, in any case).
	    Ghostscript now assumes officially, as it always did in
	    practice, that device bitmaps are stored MSB first, i.e., X=0
	    corresponds to the 0x80 bit in the first byte.

	- Removes the initial_matrix member, which wasn't actually being
	    set up.

	- Adds a new member 'name', a string giving the device name.

	- Adds new members 'x_pixels_per_inch' and 'y_pixels_per_inch'.
	    These are only used by the default initial_matrix procedure
	    (see below).

	- Adds a new procedure 'output_page'.  The default implementation
	    (gx_default_output_page) just calls the sync_output procedure.

	- Adds a new procedure 'get_initial_matrix'.  The default
	    procedure uses the width, height, and x/y_pixels_per_inch
	    members to compute the matrix, assuming that X values run from
	    right to left, and Y values run from top to bottom.

Changes the names of the allocation procedure types gs_proc_alloc and
gs_proc_free to proc_alloc_t and proc_free_t, and moves them from gs.h to
std.h.

Makes Ghostscript work even when the &gt;&gt; operator doesn't sign-extend
negative numbers.  (This has not been tested.)

</pre>

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996, 1997, 1998 Aladdin Enterprises.
All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003

<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>History of Ghostscript versions 3.n</title>
<!-- $Id: History3.htm,v 1.29 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: history3.txt -->
<!--
	WARNING: do not use Pete Kaiser's emacs function "gs-toc" alone to
	re-create the table of contents here, because it will replace the
	hand-edited TOC subheads with a separate subhead for each H2 in
	the body of the file.  Or if you do, first look at the original
	TOC to see how to edit it for visual conciseness.
-->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>History of Ghostscript versions 3.n</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Version3.70p1">Version 3.70 patch 1 (6/24/96)</a>
<ul>
<li><a href="#V3.70p1_Procedures">Procedures</a>,
    <a href="#V3.70p1_Drivers">Drivers</a>
</ul>
<li><a href="#Version3.70">Version 3.70 (limited) (6/23/96)</a>
<ul>
<li><a href="#V3.70_Documentation">Documentation</a>,
    <a href="#V3.70_Procedures">Procedures</a>,
    <a href="#V3.70_Drivers">Drivers</a>,
    <a href="#V3.70_Platforms">Platforms</a>,
    <a href="#V3.70_Fonts">Fonts</a>,
    <a href="#V3.70_Interpreter">Interpreter</a>,
    <a href="#V3.70_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.70_Streams">Streams</a>,
    <a href="#V3.70_Library">Library</a>
</ul>
<li><a href="#Version3.69">Version 3.69 (limited) (6/14/96)</a>
<ul>
<li><a href="#V3.69_Documentation">Documentation</a>,
    <a href="#V3.69_Procedures">Procedures</a>,
    <a href="#V3.69_Utilities">Utilities</a>,
    <a href="#V3.69_Drivers">Drivers</a>,
    <a href="#V3.69_Platforms">Platforms</a>,
    <a href="#V3.69_Fonts">Fonts</a>,
    <a href="#V3.69_Interpreter">Interpreter</a>,
    <a href="#V3.69_Library">Library</a>
</ul>
<li><a href="#Version3.68p4">Version 3.68 patch 4 (5/23/96)</a>
<ul>
<li><a href="#V3.68p4_Documentation">Documentation</a>,
    <a href="#V3.68p4_Procedures">Procedures</a>,
    <a href="#V3.68p4_Drivers">Drivers</a>,
    <a href="#V3.68p4_Platforms">Platforms</a>,
    <a href="#V3.68p4_Fonts">Fonts</a>,
    <a href="#V3.68p4_Interpreter">Interpreter</a>,
    <a href="#V3.68p4_Library">Library</a>
</ul>
<li><a href="#Version3.68p3">Version 3.68 patch 3 (5/17/96)</a>
<ul>
<li><a href="#V3.68p3_Procedures">Procedures</a>,
    <a href="#V3.68p3_Utilities">Utilities</a>,
    <a href="#V3.68p3_Drivers">Drivers</a>,
    <a href="#V3.68p3_Platforms">Platforms</a>,
    <a href="#V3.68p3_Interpreter">Interpreter</a>,
    <a href="#V3.68p3_Library">Library</a>
</ul>
<li><a href="#Version3.68p2">Version 3.68 patch 2 (5/13/96)</a>
<ul>
<li><a href="#V3.68p2_Documentation">Documentation</a>,
    <a href="#V3.68p2_Procedures">Procedures</a>,
    <a href="#V3.68p2_Drivers">Drivers</a>,
    <a href="#V3.68p2_Interpreter">Interpreter</a>,
    <a href="#V3.68p2_Streams">Streams</a>,
    <a href="#V3.68p2_Library">Library</a>
</ul>
<li><a href="#Version3.68p1">Version 3.68 patch 1 (5/10/96)</a>
<ul>
<li><a href="#V3.68p1_Procedures">Procedures</a>
</ul>
<li><a href="#Version3.68">Version 3.68 (limited) (5/9/96)</a>
<ul>
<li><a href="#V3.68_Documentation">Documentation</a>,
    <a href="#V3.68_Procedures">Procedures</a>,
    <a href="#V3.68_Utilities">Utilities</a>,
    <a href="#V3.68_Drivers">Drivers</a>,
    <a href="#V3.68_Platforms">Platforms</a>,
    <a href="#V3.68_Fonts">Fonts</a>,
    <a href="#V3.68_Interpreter">Interpreter</a>,
    <a href="#V3.68_Streams">Streams</a>,
    <a href="#V3.68_Library">Library</a>
</ul>
<li><a href="#Version3.67">Version 3.67 (limited) (4/12/96)</a>
<ul>
<li><a href="#V3.67_Documentation">Documentation</a>,
    <a href="#V3.67_Procedures">Procedures</a>,
    <a href="#V3.67_Platforms">Platforms</a>,
    <a href="#V3.67_Interpreter">Interpreter</a>,
    <a href="#V3.67_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.67_Library">Library</a>
</ul>
<li><a href="#Version3.66">Version 3.66 (limited) (4/8/96)</a>
<ul>
<li><a href="#V3.66_Documentation">Documentation</a>,
    <a href="#V3.66_Procedures">Procedures</a>,
    <a href="#V3.66_Utilities">Utilities</a>,
    <a href="#V3.66_Drivers">Drivers</a>,
    <a href="#V3.66_Platforms">Platforms</a>,
    <a href="#V3.66_Fonts">Fonts</a>,
    <a href="#V3.66_Interpreter">Interpreter</a>,
    <a href="#V3.66_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.66_Streams">Streams</a>,
    <a href="#V3.66_Library">Library</a>
</ul>
<li><a href="#Version3.65">Version 3.65 (limited) (3/9/96)</a>
<ul>
<li><a href="#V3.65_Documentation">Documentation</a>,
    <a href="#V3.65_Procedures">Procedures</a>,
    <a href="#V3.65_Utilities">Utilities</a>,
    <a href="#V3.65_Drivers">Drivers</a>,
    <a href="#V3.65_Platforms">Platforms</a>,
    <a href="#V3.65_Interpreter">Interpreter</a>,
    <a href="#V3.65_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.65_Streams">Streams</a>,
    <a href="#V3.65_Library">Library</a>
</ul>
<li><a href="#Version3.64">Version 3.64 (limited, incremental) (1/27/96)</a>
<ul>
<li><a href="#V3.64_Documentation">Documentation</a>,
    <a href="#V3.64_Procedures">Procedures</a>,
    <a href="#V3.64_Utilities">Utilities</a>,
    <a href="#V3.64_Drivers">Drivers</a>,
    <a href="#V3.64_Platforms">Platforms</a>,
    <a href="#V3.64_Interpreter">Interpreter</a>,
    <a href="#V3.64_Streams">Streams</a>,
    <a href="#V3.64_Library">Library</a>
</ul>
<li><a href="#Version3.63">Version 3.63 (limited, incremental) (1/14/96)</a>
<ul>
<li><a href="#V3.63_Documentation">Documentation</a>,
    <a href="#V3.63_Procedures">Procedures</a>,
    <a href="#V3.63_Utilities">Utilities</a>,
    <a href="#V3.63_Drivers">Drivers</a>,
    <a href="#V3.63_Platforms">Platforms</a>,
    <a href="#V3.63_Interpreter">Interpreter</a>,
    <a href="#V3.63_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.63_Streams">Streams</a>,
    <a href="#V3.63_Library">Library</a>
</ul>
<li><a href="#Version3.62">Version 3.62 (limited, incremental) (12/26/95)</a>
<ul>
<li><a href="#V3.62_Documentation">Documentation</a>,
    <a href="#V3.62_Procedures">Procedures</a>,
    <a href="#V3.62_Interpreter">Interpreter</a>,
    <a href="#V3.62_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.62_Library">Library</a>
</ul>
<li><a href="#Version3.61">Version 3.61 (limited) (12/10/95)</a>
<ul>
<li><a href="#V3.61_Documentation">Documentation</a>,
    <a href="#V3.61_Procedures">Procedures</a>,
    <a href="#V3.61_Utilities">Utilities</a>,
    <a href="#V3.61_Drivers">Drivers</a>,
    <a href="#V3.61_Platforms">Platforms</a>,
    <a href="#V3.61_Fonts">Fonts</a>,
    <a href="#V3.61_Interpreter">Interpreter</a>,
    <a href="#V3.61_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.61_Streams">Streams</a>,
    <a href="#V3.61_Library">Library</a>
</ul>
<li><a href="#Version3.60">Version 3.60 (limited) (11/20/95)</a>
<ul>
<li><a href="#V3.60_Documentation">Documentation</a>,
    <a href="#V3.60_Procedures">Procedures</a>,
    <a href="#V3.60_Utilities">Utilities</a>,
    <a href="#V3.60_Drivers">Drivers</a>,
    <a href="#V3.60_Platforms">Platforms</a>,
    <a href="#V3.60_Fonts">Fonts</a>,
    <a href="#V3.60_Interpreter">Interpreter</a>,
    <a href="#V3.60_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.60_Streams">Streams</a>,
    <a href="#V3.60_Library">Library</a>
</ul>
<li><a href="#Version3.53">Version 3.53 (1/10/96)</a>
<ul>
<li><a href="#V3.53_Documentation">Documentation</a>,
    <a href="#V3.53_Procedures">Procedures</a>,
    <a href="#V3.53_Utilities">Utilities</a>,
    <a href="#V3.53_Drivers">Drivers</a>,
    <a href="#V3.53_Platforms">Platforms</a>,
    <a href="#V3.53_Fonts">Fonts</a>,
    <a href="#V3.53_Interpreter">Interpreter</a>,
    <a href="#V3.53_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.53_Streams">Streams</a>,
    <a href="#V3.53_Library">Library</a>
</ul>
<li><a href="#Version3.52">Version 3.52 (limited) (10/6/95)</a>
<ul>
<li><a href="#V3.52_Procedures">Procedures</a>,
    <a href="#V3.52_Interpreter">Interpreter</a>,
    <a href="#V3.52_Library">Library</a>
</ul>
<li><a href="#Version3.51">Version 3.51 (9/27/95)</a>
<ul>
<li><a href="#V3.51_Documentation">Documentation</a>,
    <a href="#V3.51_Procedures">Procedures</a>,
    <a href="#V3.51_Utilities">Utilities</a>,
    <a href="#V3.51_Drivers">Drivers</a>,
    <a href="#V3.51_Platforms">Platforms</a>,
    <a href="#V3.51_Interpreter">Interpreter</a>,
    <a href="#V3.51_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.51_Library">Library</a>
</ul>
<li><a href="#Version3.50">Version 3.50 (limited) (9/24/95)</a>
<ul>
<li><a href="#V3.50_Procedures">Procedures</a>,
    <a href="#V3.50_Utilities">Utilities</a>,
    <a href="#V3.50_Drivers">Drivers</a>,
    <a href="#V3.50_Interpreter">Interpreter</a>,
    <a href="#V3.50_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.50_Library">Library</a>
</ul>
<li><a href="#Version3.49">Version 3.49 (limited) (9/20/95)</a>
<ul>
<li><a href="#V3.49_Documentation">Documentation</a>,
    <a href="#V3.49_Procedures">Procedures</a>,
    <a href="#V3.49_Drivers">Drivers</a>,
    <a href="#V3.49_Platforms">Platforms</a>,
    <a href="#V3.49_Interpreter">Interpreter</a>,
    <a href="#V3.49_Library">Library</a>
</ul>
<li><a href="#Version3.48">Version 3.48 (limited) (9/17/95)</a>
<ul>
<li><a href="#V3.48_Documentation">Documentation</a>,
    <a href="#V3.48_Procedures">Procedures</a>,
    <a href="#V3.48_Drivers">Drivers</a>,
    <a href="#V3.48_Platforms">Platforms</a>,
    <a href="#V3.48_Interpreter">Interpreter</a>,
    <a href="#V3.48_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.48_Library">Library</a>
</ul>
<li><a href="#Version3.47">Version 3.47 (limited) (9/14/95)</a>
<ul>
<li><a href="#V3.47_Documentation">Documentation</a>,
    <a href="#V3.47_Procedures">Procedures</a>,
    <a href="#V3.47_Utilities">Utilities</a>,
    <a href="#V3.47_Drivers">Drivers</a>,
    <a href="#V3.47_Platforms">Platforms</a>,
    <a href="#V3.47_Fonts">Fonts</a>,
    <a href="#V3.47_Interpreter">Interpreter</a>,
    <a href="#V3.47_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.47_Streams">Streams</a>,
    <a href="#V3.47_Library">Library</a>
</ul>
<li><a href="#Version3.46">Version 3.46 (limited) (9/4/95)</a>
<ul>
<li><a href="#V3.46_Documentation">Documentation</a>,
    <a href="#V3.46_Procedures">Procedures</a>,
    <a href="#V3.46_Utilities">Utilities</a>,
    <a href="#V3.46_Drivers">Drivers</a>,
    <a href="#V3.46_Platforms">Platforms</a>,
    <a href="#V3.46_Interpreter">Interpreter</a>,
    <a href="#V3.46_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.46_Library">Library</a>
</ul>
<li><a href="#Version3.45">Version 3.45 (limited) (8/27/95)</a>
<ul>
<li><a href="#V3.45_Documentation">Documentation</a>,
    <a href="#V3.45_Procedures">Procedures</a>,
    <a href="#V3.45_Utilities">Utilities</a>,
    <a href="#V3.45_Drivers">Drivers</a>,
    <a href="#V3.45_Platforms">Platforms</a>,
    <a href="#V3.45_Interpreter">Interpreter</a>,
    <a href="#V3.45_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.45_Streams">Streams</a>,
    <a href="#V3.45_Library">Library</a>
</ul>
<li><a href="#Version3.44">Version 3.44 (limited) (8/21/95)</a>
<ul>
<li><a href="#V3.44_Documentation">Documentation</a>,
    <a href="#V3.44_Procedures">Procedures</a>,
    <a href="#V3.44_Utilities">Utilities</a>,
    <a href="#V3.44_Drivers">Drivers</a>,
    <a href="#V3.44_Platforms">Platforms</a>,
    <a href="#V3.44_Interpreter">Interpreter</a>,
    <a href="#V3.44_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.44_Library">Library</a>
</ul>
<li><a href="#Version3.43">Version 3.43 (limited) (8/10/95)</a>
<ul>
<li><a href="#V3.43_Documentation">Documentation</a>,
    <a href="#V3.43_Procedures">Procedures</a>,
    <a href="#V3.43_Platforms">Platforms</a>,
    <a href="#V3.43_Fonts">Fonts</a>,
    <a href="#V3.43_Interpreter">Interpreter</a>,
    <a href="#V3.43_Streams">Streams</a>,
    <a href="#V3.43_Library">Library</a>
</ul>
<li><a href="#Version3.42">Version 3.42 (limited) (8/2/95)</a>
<ul>
<li><a href="#V3.42_Documentation">Documentation</a>,
    <a href="#V3.42_Procedures">Procedures</a>,
    <a href="#V3.42_Platforms">Platforms</a>,
    <a href="#V3.42_Interpreter">Interpreter</a>,
    <a href="#V3.42_Streams">Streams</a>,
    <a href="#V3.42_Library">Library</a>
</ul>
<li><a href="#Version3.41">Version 3.41 (limited) (7/27/95)</a>
<ul>
<li><a href="#V3.41_Documentation">Documentation</a>,
    <a href="#V3.41_Procedures">Procedures</a>,
    <a href="#V3.41_Utilities">Utilities</a>,
    <a href="#V3.41_Drivers">Drivers</a>,
    <a href="#V3.41_Platforms">Platforms</a>,
    <a href="#V3.41_Fonts">Fonts</a>,
    <a href="#V3.41_Interpreter">Interpreter</a>,
    <a href="#V3.41_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.41_Streams">Streams</a>,
    <a href="#V3.41_Library">Library</a>
</ul>
<li><a href="#Version3.40">Version 3.40 (limited) (6/28/95)</a>
<ul>
<li><a href="#V3.40_Documentation">Documentation</a>,
    <a href="#V3.40_Procedures">Procedures</a>,
    <a href="#V3.40_Utilities">Utilities</a>,
    <a href="#V3.40_Platforms">Platforms</a>,
    <a href="#V3.40_Interpreter">Interpreter</a>,
    <a href="#V3.40_Streams">Streams</a>,
    <a href="#V3.40_Library">Library</a>
</ul>
<li><a href="#Version3.39">Version 3.39 (limited) (6/24/95)</a>
<ul>
<li><a href="#V3.39_Documentation">Documentation</a>,
    <a href="#V3.39_Procedures">Procedures</a>,
    <a href="#V3.39_Utilities">Utilities</a>,
    <a href="#V3.39_Platforms">Platforms</a>,
    <a href="#V3.39_Fonts">Fonts</a>,
    <a href="#V3.39_Interpreter">Interpreter</a>,
    <a href="#V3.39_Streams">Streams</a>,
    <a href="#V3.39_Library">Library</a>
</ul>
<li><a href="#Version3.38">Version 3.38 (limited) (6/18/95)</a>
<ul>
<li><a href="#V3.38_Documentation">Documentation</a>,
    <a href="#V3.38_Procedures">Procedures</a>,
    <a href="#V3.38_Utilities">Utilities</a>,
    <a href="#V3.38_Drivers">Drivers</a>,
    <a href="#V3.38_Platforms">Platforms</a>,
    <a href="#V3.38_Fonts">Fonts</a>,
    <a href="#V3.38_Interpreter">Interpreter</a>,
    <a href="#V3.38_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.38_Streams">Streams</a>,
    <a href="#V3.38_Library">Library</a>
</ul>
<li><a href="#Version3.37">Version 3.37 (limited) (5/11/95)</a>
<ul>
<li><a href="#V3.37_Documentation">Documentation</a>,
    <a href="#V3.37_Procedures">Procedures</a>,
    <a href="#V3.37_Utilities">Utilities</a>,
    <a href="#V3.37_Drivers">Drivers</a>,
    <a href="#V3.37_Fonts">Fonts</a>,
    <a href="#V3.37_Interpreter_PostScript">Interpreter (PostScript)</a>,
    <a href="#V3.37_Interpreter_PDF">Interpreter (PDF)</a>
</ul>
<li><a href="#Version3.36">Version 3.36 (limited) (5/4/95)</a>
<ul>
<li><a href="#V3.36_Documentation">Documentation</a>,
    <a href="#V3.36_Procedures">Procedures</a>,
    <a href="#V3.36_Drivers">Drivers</a>,
    <a href="#V3.36_Interpreter">Interpreter</a>,
    <a href="#V3.36_Library">Library</a>
</ul>
<li><a href="#Version3.35">Version 3.35 (internal) (5/2/95)</a>
<ul>
<li><a href="#V3.35_Documentation">Documentation</a>,
    <a href="#V3.35_Procedures">Procedures</a>,
    <a href="#V3.35_Utilities">Utilities</a>,
    <a href="#V3.35_Drivers">Drivers</a>,
    <a href="#V3.35_Platforms">Platforms</a>,
    <a href="#V3.35_Fonts">Fonts</a>,
    <a href="#V3.35_Interpreter">Interpreter</a>,
    <a href="#V3.35_Library">Library</a>
</ul>
<li><a href="#Version3.34">Version 3.34 (internal) (4/18/95)</a>
<ul>
<li><a href="#V3.34_Documentation">Documentation</a>,
    <a href="#V3.34_Procedures">Procedures</a>,
    <a href="#V3.34_Interpreter">Interpreter</a>,
    <a href="#V3.34_Library">Library</a>
</ul>
<li><a href="#Version3.33">Version 3.33 (4/13/95)</a>
<ul>
<li><a href="#V3.33_Documentation">Documentation</a>,
    <a href="#V3.33_Procedures">Procedures</a>,
    <a href="#V3.33_Utilities">Utilities</a>,
    <a href="#V3.33_Drivers">Drivers</a>,
    <a href="#V3.33_Platforms">Platforms</a>,
    <a href="#V3.33_Fonts">Fonts</a>,
    <a href="#V3.33_Library">Library</a>
</ul>
<li><a href="#Version3.32">Version 3.32 (4/7/95)</a>
<ul>
<li><a href="#V3.32_Documentation">Documentation</a>,
    <a href="#V3.32_Procedures">Procedures</a>,
    <a href="#V3.32_Utilities">Utilities</a>,
    <a href="#V3.32_Drivers">Drivers</a>,
    <a href="#V3.32_Platforms">Platforms</a>,
    <a href="#V3.32_Interpreter">Interpreter</a>,
    <a href="#V3.32_Streams">Streams</a>,
    <a href="#V3.32_Library">Library</a>
</ul>
<li><a href="#Version3.31">Version 3.31 (4/2/95)</a>
<ul>
<li><a href="#V3.31_Documentation">Documentation</a>,
    <a href="#V3.31_Procedures">Procedures</a>,
    <a href="#V3.31_Utilities">Utilities</a>,
    <a href="#V3.31_Drivers">Drivers</a>,
    <a href="#V3.31_Platforms">Platforms</a>,
    <a href="#V3.31_Interpreter">Interpreter</a>,
    <a href="#V3.31_Streams">Streams</a>,
    <a href="#V3.31_Library">Library</a>
</ul>
<li><a href="#Version3.30">Version 3.30 (beta) (3/21/95)</a>
<ul>
<li><a href="#V3.30_Documentation">Documentation</a>,
    <a href="#V3.30_Utilities">Utilities</a>,
    <a href="#V3.30_Drivers">Drivers</a>,
    <a href="#V3.30_Interpreter_PostScript">Interpreter (PostScript)</a>,
    <a href="#V3.30_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.30_Library">Library</a>
</ul>
<li><a href="#Version3.29">Version 3.29 (internal) (3/8/95)</a>
<ul>
<li><a href="#V3.29_Documentation">Documentation</a>,
    <a href="#V3.29_Procedures">Procedures</a>,
    <a href="#V3.29_Utilities">Utilities</a>,
    <a href="#V3.29_Fonts">Fonts</a>,
    <a href="#V3.29_Drivers">Drivers</a>,
    <a href="#V3.29_Interpreter_PostScript">Interpreter (PostScript)</a>,
    <a href="#V3.29_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.29_Streams">Streams</a>,
    <a href="#V3.29_Library">Library</a>
</ul>
<li><a href="#Version3.28">Version 3.28 (beta) (2/13/95)</a>
<ul>
<li><a href="#V3.28_Documentation">Documentation</a>,
    <a href="#V3.28_Procedures">Procedures</a>,
    <a href="#V3.28_Utilities">Utilities</a>,
    <a href="#V3.28_Drivers">Drivers</a>,
    <a href="#V3.28_Interpreter">Interpreter</a>,
    <a href="#V3.28_Library">Library</a>
</ul>
<li><a href="#Version3.27">Version 3.27 (beta)(withdrawn) (2/8/95)</a>
<ul>
<li><a href="#V3.27_Documentation">Documentation</a>,
    <a href="#V3.27_Procedures">Procedures</a>,
    <a href="#V3.27_Utilities">Utilities</a>,
    <a href="#V3.27_Drivers">Drivers</a>,
    <a href="#V3.27_Platforms">Platforms</a>,
    <a href="#V3.27_Fonts">Fonts</a>,
    <a href="#V3.27_Interpreter">Interpreter</a>,
    <a href="#V3.27_Streams">Streams</a>,
    <a href="#V3.27_Library">Library</a>
</ul>
<li><a href="#Version3.26">Version 3.26 (beta) (2/1/95)</a>
<ul>
<li><a href="#V3.26_Documentation">Documentation</a>,
    <a href="#V3.26_Procedures">Procedures</a>,
    <a href="#V3.26_Utilities">Utilities</a>,
    <a href="#V3.26_Drivers">Drivers</a>,
    <a href="#V3.26_Platforms">Platforms</a>,
    <a href="#V3.26_Interpreter">Interpreter</a>,
    <a href="#V3.26_Streams">Streams</a>,
    <a href="#V3.26_Library">Library</a>
</ul>
<li><a href="#Version3.25">Version 3.25 (beta) (1/24/95)</a>
<ul>
<li><a href="#V3.25_Documentation">Documentation</a>,
    <a href="#V3.25_Procedures">Procedures</a>,
    <a href="#V3.25_Drivers">Drivers</a>,
    <a href="#V3.25_Platforms">Platforms</a>,
    <a href="#V3.25_Interpreter">Interpreter</a>,
    <a href="#V3.25_Library">Library</a>
</ul>
<li><a href="#Version3.24">Version 3.24 (beta) (1/17/95)</a>
<ul>
<li><a href="#V3.24_Documentation">Documentation</a>,
    <a href="#V3.24_Procedures">Procedures</a>,
    <a href="#V3.24_Drivers">Drivers</a>,
    <a href="#V3.24_Platforms">Platforms</a>,
    <a href="#V3.24_Fonts">Fonts</a>,
    <a href="#V3.24_Interpreter">Interpreter</a>,
    <a href="#V3.24_Interpreter_PostScript">Interpreter (PostScript)</a>,
    <a href="#V3.24_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.24_Streams">Streams</a>,
    <a href="#V3.24_Library">Library</a>
</ul>
<li><a href="#Version3.23">Version 3.23 (beta) (1/5/95)</a>
<ul>
<li><a href="#V3.23_Documentation">Documentation</a>,
    <a href="#V3.23_Procedures">Procedures</a>,
    <a href="#V3.23_Utilities">Utilities</a>,
    <a href="#V3.23_Drivers">Drivers</a>,
    <a href="#V3.23_Platforms">Platforms</a>,
    <a href="#V3.23_Fonts">Fonts</a>,
    <a href="#V3.23_Interpreter_PostScript">Interpreter (PostScript)</a>,
    <a href="#V3.23_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V3.23_Streams">Streams</a>,
    <a href="#V3.23_Library">Library</a>
</ul>
<li><a href="#Version3.22">Version 3.22 (beta) (11/30/94)</a>
<ul>
<li><a href="#V3.22_Procedures">Procedures</a>,
    <a href="#V3.22_Drivers">Drivers</a>,
    <a href="#V3.22_Platforms">Platforms</a>,
    <a href="#V3.22_Fonts">Fonts</a>,
    <a href="#V3.22_Interpreter">Interpreter</a>,
    <a href="#V3.22_Streams">Streams</a>,
    <a href="#V3.22_Library">Library</a>
</ul>
<li><a href="#Version3.21">Version 3.21 (beta) (11/17/94)</a>
<ul>
<li><a href="#V3.21_Documentation">Documentation</a>,
    <a href="#V3.21_Procedures">Procedures</a>,
    <a href="#V3.21_Utilities">Utilities</a>,
    <a href="#V3.21_Drivers">Drivers</a>,
    <a href="#V3.21_Platforms">Platforms</a>,
    <a href="#V3.21_Fonts">Fonts</a>,
    <a href="#V3.21_Interpreter">Interpreter</a>,
    <a href="#V3.21_Streams">Streams</a>,
    <a href="#V3.21_Library">Library</a>
</ul>
<li><a href="#Version3.20">Version 3.20 (beta) (10/31/94)</a>
<ul>
<li><a href="#V3.20_Documentation">Documentation</a>,
    <a href="#V3.20_Procedures">Procedures</a>,
    <a href="#V3.20_Utilities">Utilities</a>,
    <a href="#V3.20_Drivers">Drivers</a>,
    <a href="#V3.20_Platforms">Platforms</a>,
    <a href="#V3.20_Fonts">Fonts</a>,
    <a href="#V3.20_Interpreters">Interpreters</a>,
    <a href="#V3.20_Library">Library</a>
</ul>
<li><a href="#Version3.13">Version 3.13(private) (10/3/94)</a>
<ul>
<li><a href="#V3.13_Documentation">Documentation</a>,
    <a href="#V3.13_Procedures">Procedures</a>,
    <a href="#V3.13_Utilities">Utilities</a>,
    <a href="#V3.13_Drivers">Drivers</a>,
    <a href="#V3.13_Platforms">Platforms</a>,
    <a href="#V3.13_Fonts">Fonts</a>,
    <a href="#V3.13_Interpreter">Interpreter</a>,
    <a href="#V3.13_Streams">Streams</a>,
    <a href="#V3.13_Library">Library</a>
</ul>
<li><a href="#Version3.12">Version 3.12 (9/29/94)</a>
<ul>
<li><a href="#V3.12_Documentation">Documentation</a>,
    <a href="#V3.12_Procedures">Procedures</a>,
    <a href="#V3.12_Drivers">Drivers</a>,
    <a href="#V3.12_Platforms">Platforms</a>,
    <a href="#V3.12_Interpreter">Interpreter</a>,
    <a href="#V3.12_Streams">Streams</a>,
    <a href="#V3.12_Library">Library</a>
</ul>
<li><a href="#Version3.1.1">Version 3.1.1 (9/25/94)</a>
<ul>
<li><a href="#V3.1.1_Documentation">Documentation</a>,
    <a href="#V3.1.1_Procedures">Procedures</a>,
    <a href="#V3.1.1_Drivers">Drivers</a>,
    <a href="#V3.1.1_Platforms">Platforms</a>,
    <a href="#V3.1.1_Interpreter">Interpreter</a>
</ul>
<li><a href="#Version3.1">Version 3.1 (9/20/94)</a>
<ul>
<li><a href="#V3.1_Documentation">Documentation</a>,
    <a href="#V3.1_Procedures">Procedures</a>,
    <a href="#V3.1_Drivers">Drivers</a>,
    <a href="#V3.1_Interpreter">Interpreter</a>,
    <a href="#V3.1_Streams">Streams</a>,
    <a href="#V3.1_Library">Library</a>
</ul>
<li><a href="#Version3.0.3">Version 3.0.3 (9/16/94)</a>
<ul>
<li><a href="#V3.0.3_Documentation">Documentation</a>,
    <a href="#V3.0.3_Procedures">Procedures</a>,
    <a href="#V3.0.3_Utilities">Utilities</a>,
    <a href="#V3.0.3_Drivers">Drivers</a>,
    <a href="#V3.0.3_Platforms">Platforms</a>,
    <a href="#V3.0.3_Fonts">Fonts</a>,
    <a href="#V3.0.3_Streams">Streams</a>,
    <a href="#V3.0.3_Interpreter">Interpreter</a>,
    <a href="#V3.0.3_Library">Library</a>
</ul>
<li><a href="#Version3.02">Version 3.02 (8/30/94)</a>
<ul>
<li><a href="#V3.02_Documentation">Documentation</a>,
    <a href="#V3.02_Procedures">Procedures</a>,
    <a href="#V3.02_Utilities">Utilities</a>,
    <a href="#V3.02_Drivers">Drivers</a>,
    <a href="#V3.02_Platforms">Platforms</a>,
    <a href="#V3.02_Fonts">Fonts</a>,
    <a href="#V3.02_Interpreter">Interpreter</a>,
    <a href="#V3.02_Streams">Streams</a>,
    <a href="#V3.02_Library">Library</a>
</ul>
<li><a href="#Version3.01">Version 3.01 (8/14/94)</a>
<ul>
<li><a href="#V3.01_Documentation">Documentation</a>,
    <a href="#V3.01_Procedures">Procedures</a>,
    <a href="#V3.01_Utilities">Utilities</a>,
    <a href="#V3.01_Drivers">Drivers</a>,
    <a href="#V3.01_Platforms">Platforms</a>,
    <a href="#V3.01_Fonts">Fonts</a>,
    <a href="#V3.01_Interpreter">Interpreter</a>,
    <a href="#V3.01_Streams">Streams</a>,
    <a href="#V3.01_Library">Library</a>
</ul>
<li><a href="#Version3.0">Version 3.0 (8/1/94)</a>
<ul>
<li><a href="#V3.0_Documentation">Documentation</a>,
    <a href="#V3.0_Procedures">Procedures</a>,
    <a href="#V3.0_Utilities">Utilities</a>,
    <a href="#V3.0_Drivers">Drivers</a>,
    <a href="#V3.0_Platforms">Platforms</a>,
    <a href="#V3.0_Fonts">Fonts</a>,
    <a href="#V3.0_Interpreter">Interpreter</a>,
    <a href="#V3.0_Streams">Streams</a>,
    <a href="#V3.0_Library">Library</a>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>
This document is a history of Ghostscript releases numbered 3.n.  For more
recent changes, see the the other history documents and, for the latest
versions, the news:

<blockquote>
<a href="News.htm">News</a><br>
<a href="History4.htm">History of Ghostscript versions 4.n</a><br>
History of Ghostscript versions 3.n (this document)<br>
<a href="History2.htm">History of Ghostscript versions 2.n</a><br>
<a href="History1.htm">History of Ghostscript versions 1.n</a>
</blockquote>

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<h2><a name="Version3.70p1"></a>Version 3.70 patch 1 (6/24/96)</h2>

<p>
This contains a few last-minute patches before the release.

<h3><a name="V3.70p1_Procedures"></a>Procedures</h3><pre>
Comments out the color inkjet drivers in the cc-based makefile, because a
bug in Sun's cc prevents them from compiling.  (cc-head.mak)

</pre><h3><a name="V3.70p1_Drivers"></a>Drivers</h3><pre>
Fixes bugs:
	- The os2prn driver smashed memory.  (gdevos2p.c)
	- Some initialized structures weren't declared 'static'.
(gdevpdf.c, gdevpdfm.c)
	- The PNG driver wouldn't compile with some older versions of the
PNG library.  (gdevpng.c)

</pre>

<h2><a name="Version3.70"></a>Version 3.70 (limited) (6/23/96)</h2>

<p>
This is the candidate fileset for 4.0.  Aside from one optimization
for the PDF writer, the only changes are bug fixes.

<h3><a name="V3.70_Documentation"></a>Documentation</h3><pre>

Renames all the documentation files from *.doc to *.txt, since the .doc
extension didn't give any information about the format of the file.
(readme, *.doc, *.txt)

Notes that IJG JPEG library v6[a] is now required.  (jpeg.mak)

Brings ps2pdf.1 up to date.  (ps2pdf.1)

Adds a new file describing Aladdin's C coding practices.  (c-style.txt)

Updates the man pages to refer to version 4.0.  (gs.1, pdf2ps.1, ps2ascii.1,
ps2pdf.1)

</pre><h3><a name="V3.70_Procedures"></a>Procedures</h3><pre>

Changes some file names to fit within the MS-DOS 8.3 limit.  (gs.mak)

Adds the PDF writer to the remaining 32-bit configurations (Watcom, OS/2,
MSC).  (watc.mak, watcwin.mak, os2.mak, msc.mak, msvcwint.mak)

Changes the -sFONTMAP= switch so it can take a list of font names, like a
search path.  (use.txt)

</pre><h3><a name="V3.70_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Signed and unsigned values were mixed inconsistently.  (gdevcdj.c)
	- PDF files could contain e-format floating point numbers, which the
PDF specification doesn't allow.  (gdevpdfx.h, gdevpdf*.c)
	- The PDF writer didn't handle glyphshow properly.  (gs_pdfwr.ps)
	- The PDF writer did the wrong thing with fonts whose FontMatrix had
a non-zero translation component.  (gs_pdfwr.ps, gdevpdft.c)
	- The stand-alone bounding box device could crash when setting
parameters.  (gdevbbox.c)
	- The mswinpr2 driver smashed memory.  (gdevwpr2.c)

Changes the PDF writer so that if it encounters a re-encoded character, it
tries to map it to an encoded character in the standard (ISO Latin-1)
encoding rather than converting the entire string containing it to a bitmap.
This dramatically improves output file size for files with a few divergently
encoded characters, but it may cause the text in the PDF file to differ from
the text in the PostScript input.  (gdevpdft.c)

Disallows BitsPerPixel=16 in the MS Windows and OS/2 drivers, since this bit
depth is not supported by Windows and would require special extra buffering.
(install.txt, dwtext.h, dwtext.cpp, gdevmswn.c, gdevpm.c, gdevwpr2.c)

</pre><h3><a name="V3.70_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- On the PC platforms, file names weren't changed to reflect the
value of CONFIG.  (gs.mak, bc*.mak, ms*.mak, os2.mak, tc*.mak, watc*.mak,
wccommon.mak)

Modifies some makefiles for greater reusability.  (bclib.mak, watclib.mak)

</pre><h3><a name="V3.70_Fonts"></a>Fonts</h3><pre>

Changes the font searching rules in the following NON-BACKWARD-COMPATIBLE
way: (gs_fonts.ps, gs_res.ps)
	- -sFONTMAP=files specifies a list of files containing fontmaps;
previously, it specified only a single fontmap file.
	- If -sFONTMAP= is not used, the interpreter reads the Fontmaps from
*all* directories on the search path, and does so even if FONTPATH or
GS_FONTPATH is set; previously, it read only the first Fontmap, and only if
[GS_]FONTPATH was not set.
	- Fontmap(s) take precedence over [GS_]FONTPATH; previously,
[GS_]FONTPATH caused Fontmap to be ignored.  (You can still force Fontmap to
be ignored with -dNOFONTMAP.)
	- Earlier [GS_]FONTPATH entries take precedence over later;
previously, later entries took precedence over earlier.  Note that this is
different from Fontmap: earlier Fontmaps in the search path take precedence
over later, but within a single Fontmap, later entries take precedence over
earlier (for backward compatibility).
	- [GS_]FONTPATH is consulted only if there is no Fontmap entry for a
font, or no Fontmap entry leads to successful loading; previously,
[GS_]FONTPATH was always consulted at startup.
	- If loading a font fails, the interpreter tries the next Fontmap
entry; previously, it fell back to font substitution.

</pre><h3><a name="V3.70_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Filters didn't peek ahead for an EOD (see Streams below).
(zfileio.c, zpaint.c)

Splits up a file to allow internal access to user and system parameters even
in Level 1.  (zmisc2.c, zusparam.c)

Adds LIBPATH as a predefined name in systemdict.  Its value is an array of
strings comprising the library search path.  (imain.c)

</pre><h3><a name="V3.70_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- A Dests dictionary entry with an array (rather than a dictionary)
value caused an error.  (pdf_main.ps)
	- Rotated pages could have incorrect translation and/or clipping.
(pdf_main.ps)

</pre><h3><a name="V3.70_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- If a buffer boundary fell just before an EOD, and the client read
exactly as much data as was present before the EOD, filters didn't consume
the EOD.  (This is required as a tricky consequence of the Adobe
specification.)  (stream.h, strimpl.h, stream.c)

</pre><h3><a name="V3.70_Library"></a>Library</h3><pre>

Fixes bugs:
	- An extra column of bits could get turned on at the right edge of
masked or monochrome images.  (gximage2.c)
	- Rasterizing very long curves could cause arithmetic errors or
floating point overflows.  (gxpcopy.c)
	- Banding with large line widths could truncate curves or introduce
spurious lines.  (gxclpath.c)

</pre>

<hr>

<h2><a name="Version3.69"></a>Version 3.69 (limited) (6/14/96)</h2>

<p>
More bug fixes, plus one irresistible new feature: the ability to use
TrueType fonts as freely as Type 1 fonts.  Also, one new feature (outside
clipping) that was needed for Aladdin's PCL XL project.  We incremented the
version number because of the change in trapezoid and path filling (see
under Library below).

<h3><a name="V3.69_Documentation"></a>Documentation</h3><pre>
Brings documentation about fonts up to date.  (fonts.doc)

Updates current.doc to reflect changes since 3.53.  (current.doc)

Updates the DLL documentation to reflect recent changes.  (dll.doc)

Documents a workaround for the code generation bug in gcc 2.7.x.  (make.doc)

Changes the contact information for potential commercial customers in
Europe.  (new-user.doc)

Updates the OS/2 documentation to make it current.  (install.doc, make.doc)

Documents -dCOLORSCREEN=0.  (use.doc)

</pre><h3><a name="V3.69_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- 'make clean' didn't work in the Watcom environment.
(wmakebat.bat, gs.mak, msc.mak, msvcwint.mak, os2.mak, tccommon.mak,
unixhead.mak, wccommon.mak)
	- The X11 libraries were listed in an incorrect order.
(ansihead.mak, cc-head.mak, gcc-head.mak, ugcclib.mak, unix-end.mak)
	- The OS/2 makefile didn't ignore errors from `erase' commands.
(os2.mak)

Adds the PDF writer to the 32-bit MS Windows configuration.  (bcwin32.mak)

Adds the PNG drivers to the 32-bit MS Windows platform, since they now
compile properly.  (bcwin32.mak)

Changes the ttfont feature so that it refers to support for direct usage of
TrueType fonts; puts support for Type 42 fonts into a separate feature
(type42).  (gs.mak, int.mak)

Adds direct TrueType font support to the Windows platforms.  (bcwin.mak,
bcwin32.mak)

Rewrites vms.mak to be structured more like the other makefiles.  (vms.mak,
modules.lis)

Makes the device lists in vms-*.mak the same as those for the Unix
configurations.  (vms-cc.mak, vms-decc.mak, vms-gcc.mak)

Changes the default X library directory for gcc to /usr/X11/lib.
(gcc-head.mak)

Adds the list of devices to --help, since HylaFax depends on this.
(imainarg.c)

Adds -dCOLORSCREEN=0 to indicate use of 4 separate color screens with the
same frequency and angle.  (gs_init.ps)

</pre><h3><a name="V3.69_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- When ps2epsi encountered a blank page, it called the
(undocumented) .quit operator with only one argument, causing a stack
underflow.  (ps2epsi.ps)
	- An extraneous file was included in the fileset.  (checkacc.ps)
	- A file was omitted from the fileset.  (bench.c)
	- Images in PostScript files produced by pdf2ps were processed about
50 times slower than they should have been.  (gs_pdf.ps)

</pre><h3><a name="V3.69_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- An #include was omitted.  (gdevpdfi.c)
	- The BJC driver could get into an inconsistent state.  (gdevcdj.c)
	- Braces were omitted around the values for two initialized byte
arrays.  (gdevpcx.c)
	- A function used 'float' in its argument list, causing problems in
mixed ANSI/non-ANSI compilation.  (gdevcdj.c)
	- signed and unsigned char pointers were used inconsistently.
(gdevcdj.c, gdevcgml.c)
	- Some header files weren't protected against double inclusion.
(gdevprn.h, gdevtifs.h)
	- The 24-bit PNG driver included unnecessary copies of the color
mapping procedures.  (gdevpng.c)

Fixes bugs in the PDF writer:
	- The PDF writer sometimes produced a double // in front of a filter
name.  (gdevpdfi.c)
	- The PDF writer produced zero-width, zero-height images for
non-standard fonts.  (bug introduced since 3.68) (gdevpdfi.c)
	- The PDF writer got confused if the input file invoked
setpagedevice.  (gdevpdfp.c)
	- The PDF writer put annotations on the page after the one they were
supposed to be on.  (gdevpdf.c)
	- The PDF writer sometimes failed to set the font when needed.
(gdevpdf.c)
	- The PDF writer could produce in-line images that were too large.
(gdevpdfi.c)
	- The PDF writer didn't scale explicit character and word spacing
(ashow/widthshow/awidthshow) properly.  (gdevpdft.c)
	- The PDF writer didn't copy named destination or article title
strings, possibly leading to dangling pointers.  (gdevpdf.c, gdevpdfm.c)
	- The PDF writer produced incorrect output for re-encoded fonts.
(It now converts any string containing characters in non-standard positions
to bitmaps; this will be fixed in a later release.)  (gs_pdfwr.ps,
gdevpdfx.h, gdevpdfp.c, gdevpdft.c)

Updates a few drivers for the change in the handling of band device
procedures.  (gdevcp50.c, gdevdjet.c)

Updates the X Windows driver for strip halftones.  (gdevx.c)

Adds anti-aliasing capability to the os2pm device.  (gdevpm.c)

Increases the sizes of some tables in the PDF writer.  (gdevpdfx.h)

</pre><h3><a name="V3.69_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- A patch for the MS Windows platform was accidentally omitted.
(gp_mswin.c)
	- A block of code was accidentally duplicated.  (dwmain.cpp)
	- An identifier exceeded VAX VMS C's limit of 31 characters.
(gscspace.h)
	- File name enumeration didn't work properly on Unix systems
(still/again).  (gp_unifs.c)
	- On MS Windows, If you closed Ghostscript with the system menu, you
only closed the text window; Ghostscript kept running and you had to use the
task manager to kill it.  (dwmain.cpp, dwmainc.cpp, dwtext.cpp)
	- Some DLL-related typedefs were not consistent.  (dwdll.h, gsdll.h,
dpmainc.c, dwdll.cpp)
	- Attempts to call the DLL before it was initialized were not
detected.  (gsdll.c)
	- Bitmap line lengths were rounded up even on 32-bit Windows, which
doesn't want this.  (gdevwdib.c)

Further improves the handling of attempts to use the DLL when it is already
in use.  (dwdll.cpp, gsdll.c)

Adds a DLL-compatible main program for OS/2.  (dpmainc.c, gp_os2.c, gsdll.c)

</pre><h3><a name="V3.69_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- The WingDings TrueType font wasn't loaded properly.  (gs_ttf.ps)

Makes changes so that TrueType fonts can appear in the Fontmap and can be
loaded directly.  (gs_fonts.ps, gs_ttf.ps)

</pre><h3><a name="V3.69_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Executing a .quit with only 1 element on the operand stack caused
an invalid access.  (zcontrol.c)
	- The usage help message contained incorrect double %%s.
(imainarg.c)
	- If an initialization file tried to use any Encodings other than
the 4 registered ones, it couldn't find them.  (gs_init.ps, gs_res.ps)
	- Places that expected arrays of coordinates (rectangles,
x/y/xyshow) didn't accept packed arrays.  (ibnum.c, zdps1.c)
	- filterdict was still visible after initialization.  (gs_init.ps)
	- The usage error message wasn't terminated by a newline.
(imainarg.c)
	- setcacheparams (or setting the MaxFontCache user parameter) didn't
actually affect the size of the character cache.  (zfont.c, zmisc2.c)
	- The main interpreter loop declared iref as a ref *, even though it
may only be a ref_packed *.  (iref.h, interp.c)

Changes the character cache so it ignores absurd FontBBox values.  Nothing
in the Adobe spec suggests doing this, but it is necessary for handling
questionable output produced by PageMaker 5.0 (an Adobe product!).
(zchar1.c)

Changes some type declarations slightly to reduce the number of 'discarding
const' compiler warnings.  (igc.h, igc.c, igcref.c)

Adds .setclipoutside and .currentclipoutside operators for accessing the new
outside clipping capability.  (zpath.c)

Adds the dictionary stack to the information printed in case of a fatal
problem.  (imain.c)

Adds .set/currentrenderalgorithm operators for testing.  (zrop.c)

</pre><h3><a name="V3.69_Library"></a>Library</h3><pre>

Fixes bugs:
	- The TrueType rasterizer didn't map quadratic to cubic splines
well, and didn't handle off-curve points at the end of a contour properly.
(gstype42.c)
	- An #include was omitted.  (gsimage.c, gxclimag.c)
	- Some compilers complained about statements with no effect, or
comma operators with no effect on the left.  (gschar.c, gxcpath.c, gxfill.c)
	- TrueType or Type 42 glyphs with a repeat count that crossed a
contour boundary produced incorrect output.  (gstype42.c)
	- TrueType / Type 42 composite glyphs involving rotation were placed
incorrectly.  (gstype42.c)
	- Type 42 fonts with an absent or incorrect FontBBox could fail to
produce output.  (gstype42.c)
	- Some header files weren't protected against double inclusion.
(gsio.h, gdebug.h)
	- Decoding filters didn't "look ahead" to detect EOD, so if the last
read operation before closing the filter ended just before the EOD mark, the
EOD mark might not be absorbed.  (stream.h, stream.c)
	- Filling paths consisting of multiple subpaths that overlap in Y
produced slightly inaccurate output.  We were unable to find a way to fix
this without making a NON-BACKWARD-COMPATIBLE change in the interface for
the recently introduced fill_trapezoid device procedure.  (gxdevice.h,
gdevbbox.c, gdevddrw.c, gdevnfwd.c, gxfill.c)
	- When banding, get_bits didn't detect calls with out-of-range Y
values.  (gxclread.c)
	- setcacheparams didn't actually affect the size of the character
cache.  (gsfont.h, gxbcache.h, gxfcache.h, gschar.c, gsfont.c, gxbcache.c,
gxccman.c, gxclbits.c)
	- When banding, colored halftones could be mangled.  (gxclread.c)

Fixes bugs in the bounding box device:
	- The bounding box device could give bizarre results if any objects
crossed the lower edge of the page.  (gdevbbox.c)
	- The bounding box device could get a memory access error when
processing image data.  (gdebbox.c)
	- The bounding box device ran the default drawing algorithms even if
it had no target (performance bug only).  (gdevbbox.c)
	- The bounding box device computed an incorrect (too small) box for
partially clipped bitmap images.  (gdevbbox.c)
	- The bounding box device got confused by files that filled the
entire page with a background color.  (gdevbbox.c)
	- The bounding box device produced infinite-height boxes for certain
kinds of data.  (gdevbbox.c)

Changes some type declarations slightly to reduce the number of 'discarding
const' compiler warnings.  (gsmemory.h, gsstruct.h)

Adds the capability of clipping to the outside rather than the inside of the
clipping path.  This is required for emulating an obscure feature of the
Microsoft Windows GDI.  (gspath.h, gxclpath.h, gxpath.h, gxcpath.h,
gzcpath.h, gspath.c, gxacpath.c, gxclpath.c, gxclread.c, gxcpath.c.)

Makes it possible for band devices to select the underlying memory device
used to accumulate the actual bits.  This is required for (at least) PCL5
emulation.  This requires adding a procedure to the gx_device_printer
structure, which, for devices that initialize the structure without using
the macros in gdevprn.h or access the printer-specific procedures directly,
is a NON-BACKWARD-COMPATIBLE change.  (gdevprn.h, gxclist.h, gxdevice.h,
gdevdflt.c, gdevprn.c, gxclread.c)

Speeds up handling of rotated or halftoned masked images.  (gximage2.c)

Adds an output_page procedure to the bounding box device, for testing.
(gdevbbox.c)

Adds a sample device that keeps track of the "render algorithm", for PCL5c
emulation.  (gdevrrgb.c)

</pre>

<h2><a name="Version3.68p4"></a>Version 3.68 patch 4 (5/23/96)</h2>

<p>
More minor bug fixes, mostly related to the MS Windows implementation.

<h3><a name="V3.68p4_Documentation"></a>Documentation</h3><pre>
Further updates various doc files to make them more useful to new users.
(NEWS, README, current.doc, helpers.doc, new-user.doc)

Adds user-contributed documentation for ps2pdf.  (ps2pdf.doc, unix-end.mak)

Documents a bug in the Borland C++ 4.52 compiler, and where to find the
patch for it.  (make.doc)

</pre><h3><a name="V3.68p4_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- A command line exceeded the MS-DOS 120 character limit.
(devs.mak)

A file was accidentally omitted from the fileset.  (wmakebat.bat)

</pre><h3><a name="V3.68p4_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Many of the 'show' operators didn't work properly if the PDF
writer was included in the configuration.  (gs_pdfwr.ps)
	- x_wrap_get_bits was ridiculously slow.  (It still is, but not
quite as ridiculously.)  (gxcindex.h, gdevxalt.c)
	- The PDF writer generated CR instead of CalRGB, which is legal per
the Adobe spec but not compatible with some Adobe Acrobat products.
(gdevpdfi.c)
	- Some signed/unsigned discrepancies caused compilation warnings.
(gdevpdfm.c, gdevpdfp.c, gdevpdft.c)

Fixes bugs in the Windows driver:
	- An accidentally opened tiny window didn't get closed.
(gdevwdib.c)
	- The name DllInit was misleading, and this procedure wasn't being
called whtn the DLL was loaded, so the DLL couldn't know the instance
handle.  (gp_mswin.c)
	- The code didn't recognize Win32s (vs. Windows 95) correctly.
(dwmain.cpp, gdevwdib.c, gp_mswin.h, gp_mswin.c, gsdll16.rc)
	- Some compiler warnings needed fixing.  (gdevwdib.c)
	- gsdll16.def and gsdll32.def were different.  (gsdll32.def)
	- A GPF leaving the 16-bit DLL loaded could make the DLL permanently
unusable.  (dwmain.cpp)
	- Two obsolete files were still included in the fileset.
(gswin.def, gswin32.def)

Adds a compile-time option to the 'bit' drivers to expand 4-bit pixels to
32-bit.  This was required for tracking down customer problems, because the
only tools we have available for displaying CMYK images require 32 bits per
pixel.  (gdevbit.c)

</pre><h3><a name="V3.68p4_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- In DEC C, &lt;time.h&gt; does define the timeval struct.  (time_.h)

Changes gsdll_init() to take an additional argument, a window handle.  This
is a NON-BACKWARD-COMPATIBLE change.  (dll.doc, dwdll.h, gsdll.h, dwdll.cpp,
dwmain.cpp, dwmainc.cpp, gsdll.c)

</pre><h3><a name="V3.68p4_Fonts"></a>Fonts</h3><pre>

Updates more Fontmaps to include the new URW++ fonts.  (Fontmap.OS2,
Fontmap.ATM)

</pre><h3><a name="V3.68p4_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The default operator array table wasn't big enough.  (iinit.c)
	- Some signed/unsigned discrepancies caused compilation warnings.
(imain.c, imainarg.c, zfile.c)

Adds encoding vectors for Windows 3.1 Latin 1, Latin 2, and Latin 5
encodings.  None of these are loaded in the standard configuration.
(gs_wl{1,2,5}_e.ps)

</pre><h3><a name="V3.68p4_Library"></a>Library</h3><pre>

Fixes bugs:
	- Some tracing output was incorrect or missing.  (gxdither.c)
	- Resized objects in the C heap had incorrect bookkeeping
information (bug introduced in 3.68).  (gsmemory.c)
	- Image pixels that fell exactly on device half-pixel boundaries
could get discarded.  (gximage0.c)
	- The bounding box device didn't set a variable properly and didn't
implement end_image, leading to invalid memory accesses.  (gdevbbox.c)
	- Fonts with BuildChar routines written in C didn't work properly
with kshow or xyshow.  (gschar.c)

Adds some additional tracing output for Patterns.  (gxpcmap.c)

Adds tracing output for freeing malloc'ed blocks at the end of execution.
(gsmemory.c)

Adds a gs_dashpath procedure that expands dashes in the same way that
gs_flattenpath expands curves.  (gspath.h, gspath1.c)

</pre>

<h2><a name="Version3.68p3"></a>Version 3.68 patch 3 (5/17/96)</h2>

<p>
More bug fixes during the beta test period.  AccurateScreens now works
properly.

<h3><a name="V3.68p3_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The help message was too long to fit on a PC screen or standard
terminal.  (imainarg.c)
	- Failure to run tar_cat wasn't detected.  (unix-end.mak,
unixtail.mak)

</pre><h3><a name="V3.68p3_Utilities"></a>Utilities</h3><pre>
Fixes bugs:
	- In the PostScript files produced by pdf2ps, images using ASCII85
encoding would cause a typecheck error.  (gs_pdf.ps)
	- pdf2ps wrote out strings longer than 200 characters incorrectly.
(pdf_2ps.ps)

</pre><h3><a name="V3.68p3_Drivers"></a>Drivers</h3><pre>

Fixes bugs in gdevcdj.c (according to the author, we have no way to test
this):
	- The driver used to use Colors as well as ProcessColorModel to
define the process color model.  (devices.doc, gdevbjc.h, gdevcdj.c)
	- Incorrect or inconsistent settings of BitsPerPixel and
ProcessColorModel, or setting one but not the other, could leave the driver
in an inconsistent state.  (gdevcdj.c)

Fixes bugs in the MS Windows driver:
	- Insufficient memory for the backing bitmap could cause a GPF.
(gdevmswn.c, gdevwdib.c)
	- Invalid parameters could cause a crash within the DLL code.
(gdevwdib.c)

Adds a user-contributed driver for the CalComp Raster Format.  (devs.mak,
gdevccr.c)

Adds an anti-aliasing option for MS Windows.  (gdevmswn.c, gdevwdib.c)

</pre><h3><a name="V3.68p3_Platforms"></a>Platforms</h3><pre>

Fixes bugs in the Windows platform:
	- One had to type "quit" twice to exit.  (dwdll.h, dwdll.cpp)

</pre><h3><a name="V3.68p3_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Platform fonts didn't work properly if the document's primary
encoding was the standard MS Windows encoding.  (ifont.h, gs_wan_e.ps)
	- stringwidth with a Type 1 font could give a spurious typecheck
error (bug introduced in 3.65).  (zcharout.c)
	- If a DOS editor added a ^Z to the end of the Fontmap file, an
error occurred during initialization.  (gs_fonts.ps)
	- Halftones that didn't specify a value for AccurateScreens
sometimes ignored the setting of the AccurateScreens user parameter.
(zht2.c)

</pre><h3><a name="V3.68p3_Library"></a>Library</h3><pre>

Fixes bugs:
	- gs_join_none was defined, but not implemented.  (gxstroke.c)
	- A bookkeeping list for fonts could get confused, causing invalid
memory accesses.  (gsfont.c)
	- An I/O error or internal error would cause the band list
rasterizer to go into an infinite loop.  (gxclread.c)
	- The algorithm for choosing screen angles and frequencies produced
poor results.  (gshtscr.c)
	- Color screens were broken (bug introduced in 3.68).  (gxdht.h,
gzht.h, gsht.c, gshtscr.c)

</pre>

<h2><a name="Version3.68p2"></a>Version 3.68 patch 2 (5/13/96)</h2>

<p>
This is another set of patches for the next general release.

<h3><a name="V3.68p2_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- Windows NT and Windows 95 implementations were identified as
"under development" rather than available.  (README)
	- There were several other minor errors in the README file.
(README)
	- The claimed current IJG JPEG version was incorrect.  (jpeg.mak)

Splits off information for new users into a separate file.  (README,
new-user.doc)

</pre><h3><a name="V3.68p2_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- gettimeofday takes 2 arguments on SVR4 systems more recent than
SVR4.0.  (make.doc, ansihead.mak, cc-head.mak, gcc-head.mak, time_.h)

Changes the default Unix data installation directory from /usr/local/lib to
/usr/local/share, which seems to be favored by more recent Unix systems
(except for some Linux versions, which still use /usr/local/lib, and BSD/OS,
which puts Ghostscript in /usr/contrib/lib.)  (ansihead.mak, cc-head.mak,
gcc-head.mak, ugcclib.mak)

Changes the unset commands in the Unix script to assignments, because a few
older Unix shells don't provide unset.  (unixtail.mak)

</pre><h3><a name="V3.68p2_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- An #include incorrectly referred directly to a system header.
(gdevpdft.c)
	- CMYK devices took an excessive amount of time clearing the page to
white.  (gdevm32.c)

Adds a compile-time option to the 'bit' drivers to remove top and bottom
whitespace.  This change was required in order to track down a customer bug.
(gdevbit.c)

</pre><h3><a name="V3.68p2_Interpreter"></a>Interpreter</h3><pre>

Updates the interpreter for the split in the gstate API.  (igstate.h)

</pre><h3><a name="V3.68p2_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- Some compilers don't define NULL widely enough.  (spngp.c)

</pre><h3><a name="V3.68p2_Library"></a>Library</h3><pre>

Fixes bugs:
	- There was a minor typo (&amp; for &amp;&amp;) that didn't affect execution.
(gxccman.c)
	- There was a trailing comma in an enumeration.  (gsiparam.h)
	- Internal and public interfaces weren't separated properly.  THIS
IS A NON-BACKWARD-COMPATIBLE CHANGE for clients using certain undocumented
interfaces to the graphics state.  (gsstate.h, gxstate.h, gzstate.h,
gsstate.c)
	- A 'private' declaration was missing (yet again).  (gxclimag.c)

</pre>

<h2><a name="Version3.68p1"></a>Version 3.68 patch 1 (5/10/96)</h2>

<p>
This is the first bug fix (patch) incremental release for the next
general release.

<h3><a name="V3.68p1_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- Many Windows-specific files were omitted from the previous
fileset: dw*.rc, dw*.cpp.

</pre>

<h2><a name="Version3.68"></a>Version 3.68 (limited) (5/9/96)</h2>

<p>
This release cleans up the new Windows files, mostly implements the
high-level driver API for bitmap images, and adds practical strip
(AccurateScreens) halftoning.  This is the first "serious beta" fileset for
the next general release.  It still has more problems than I would have
liked.

<h3><a name="V3.68_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The names of the executable files for MS Windows were out of date.
(make.doc)
	- gxcindex.h still referred to "drawing color".  (gxcindex.h)
	- The name of the default font directory for Unix systems was
incorrect.  (make.doc)

Moves the list of files required for installation, and some other
installation instructions, from make.doc to install.doc.  (install.doc,
make.doc)

Adds a description of the PNGPredictor filters.  (language.doc)

Updates the documentation of the higher-level driver procedures to match the
specification changes.  (drivers.doc)

Documents the change in the Watcom build procedure.  (make.doc)

Improves the documentation of bitmap IDs.  (gxbitmap.h)

Adds documentation for the new strip_tile_rectangle and strip_copy_rop
driver procedures.  (drivers.doc)

Changes the few remaining direct FTP addresses in README to URLs.  (README)

Notes that zlib does not compile correctly on IRIX 6.n with optimization.
(make.doc)

Adds references to PDF and TrueType fonts to language.doc.  (language.doc)

Updates fonts.doc to remove references to fonts.mak.  (fonts.doc)

Describes how to substitute an LZW compressor for the LZW-compatible
compressor provided in the standard release.  (make.doc)

</pre><h3><a name="V3.68_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- Some lines had exceeded the 120-character limit of the
MS-DOS shell.  (int.mak)
	- The configuration files weren't generated correctly when CONFIG
wasn't an empty string.  (unixhead.mak)

Factors out shared DLL makefile rules into a new file.  (bcwin.mak,
bcwin32.mak, dwcommon.mak)

Makes the cp and rm commands into makefile parameters, allowing automatic
generation of build scripts even in the MS-DOS and MS Windows environments
where the shell requires the CALL command for sub-scripts.  (*.mak,
genconf.c)

Adds the PDF writer to the default Unix configurations.  (ansihead.mak,
cc-head.mak, gcc-head.mak)

Adds TrueType support to all Level 2 configurations.  (int.mak)

Removes fonts.mak, which is no longer relevant.  (fonts.mak)

Brings the font compilation procedures up to date.  (cfonts.mak, int.mak)

</pre><h3><a name="V3.68_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- There was an extra 'show' in one file.  (align.ps)

</pre><h3><a name="V3.68_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The bit devices were missing the map_color_rgb procedure.
(gdevbit.c)
	- The MS Windows driver sent a redundant message. (gdevmswn.c)

Adds a device that keeps track of the page bounding box.  This device is not
included in any standard configuration.  (drivers.doc, gdevbbox.h,
gsmatrix.h, gsstruct.h, gxdevice.h, gdevbbox.c, gdevnfwd.c, gsmatrix.c)

Updates the PDF writer to track the changes in the high-level driver API,
and to write out images in a reasonable way.  NOTE: the current
implementation doesn't write out CIE color space parameters, so CIE-color
images won't be colored accurately.  (gdevpdf.c, gdevpdfi.c)

Adds a forwarding procedure for tile_rectangle.  (gxdevice.h, gdevnfwd.c)

Changes the copyright notices on the PDF writer to be the same as on the
rest of Ghostscript.  (gdevpdf*.[ch])

Updates Gunther Hess's Epson Stylus Color driver from 1.21 to 1.90.  (Aladdin
Enterprises takes no responsibility for this driver: if you have questions,
contact the author.)  (devices.doc, devs.mak, gdevstc*.c, gdevstc.h)

</pre><h3><a name="V3.68_Platforms"></a>Platforms</h3><pre>

Removes some obsolete MS Windows files and #defines.  (gp_mswtx.h,
gp_mswtx.c, gp_mswin.h)

Works around a memory limitation in the Watcom make utility.  (wmakebat.bat)

</pre><h3><a name="V3.68_Fonts"></a>Fonts</h3><pre>

Changes the standard Fontmap from using the low-quality fonts converted from
bitmaps to using high-quality fonts recently contributed by URW++.
(Fontmap, Fontmap.GS)

</pre><h3><a name="V3.68_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- A macro containing an if-else, and a macro generating a compound
statement, could cause incorrect grouping of 'if' statements.  (files.h,
ostack.h)
	- .setrasterop didn't pop its operand.  (zrop.c)
	- A rounding inaccuracy could cause bounding box rangecheck errors.
(gsdps1.c)
	- CIE-based images in PDF files didn't work.  (gs_pdf.ps)
	- The page parameter .MediaSize didn't get updated when PageSize was
set.  (This is just the most recent manifestation of the setpagedevice
morass.)  (gs_setpd.ps)
	- %lineedit and %statementedit were limited to 160 characters.
(zfileio.c, ziodev.c)
	- Compiled initialization files didn't work properly.  (geninit.c,
gs_l2img.ps)
	- Attempting to parse a command line with argc = 0 caused a crash.
(imainarg.c)

Renames some files to allow separating the non-DLL 'main' procedure into a
separate file, and to make the file naming more consistent:
	gs.c (except for 'main') =&gt; imainarg.c
	gsmain.c =&gt; imain.c
gs.c now consists only of 'main'.  The name gs.c is still inconsistent (it
should be i- something), but at least it's consistent with the name of the
executable.  (*.mak, imain.h, iminst.h, imainarg.h, gs.c, gsmain.c, imain.c,
imainarg.c)

Adds PNGPredictorEncode/Decode filters, and increases the size of filterdict
slightly to make room for them.  (iinit.c, zfpngp.c)

Makes zwrite external, per a customer request.  (opextern.h, zfileio.c)

Updates clients to work with the new API-based bitmap imaging calls.
(iimage.h, zcolor1.c, zimage2.c, zpaint.c)

Updates clients for the split in gscspace.h.  (zcie.c, zcolor1.c, zcolor2.c,
zcsindex.c, zcssepr.c, zimage2.c, zpaint.c, zpcolor.c)

Updates clients for strip-based halftones.  (zpcolor.c)

Updates the initialization code to pass the correct (system) allocator to
the library initialization.  (imain.c)

</pre><h3><a name="V3.68_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- If a filter reached EOD exactly at the end of reading data for
certain operations, it didn't get closed automatically.  (stream.c)
	- The LZW-compatible encoding filter reset procedure had an
incorrect return type.  (slzwce.c)

Changes the ASCIIHexEncode filter to insert \ns in fewer places, to be
somewhat more compatible with the Adobe implementation.  (sstring.c)

Adds PNGPredictorEncode/Decode filters that implement the pixel prediction
algorithms in the PNG specification.  (We'd like to use the code in the PNG
library, but it's too deeply embedded in the rest of the PNG machinery, and
it also doesn't provide for suspendable I/O.)  (spngpx.h, spngp.c)

</pre><h3><a name="V3.68_Library"></a>Library</h3><pre>

Fixes bugs:
	- A test for pure color was backwards, causing garbage output or
possible address or floating point exceptions.  (gxclpath.c)
	- A macro containing an if-else could cause incorrect grouping of
'if' statements.  (gsrefct.h)
	- The default implementation of RasterOp didn't handle the device
depth correctly.  (gdevmrop.c)
	- The memory device implementation of RasterOp truncated 24-bit
constant source or texture values to 8 bits.  (gdevmrop.c)
	- A typo caused the garbage collector to miss an internal buffer
used when rendering images.  (gximage.h)
	- gs_debug_out was only defined if DEBUG was set.  (gdebug.h)
	- The raster of horizontally replicated tiles was incorrect.
(gxht.c)
	- A data type might not be declared, causing a compilation error.
(gscoord.h)
	- Empty TrueType glyphs weren't handled properly.  (gstype42.c)
	- Fonts with a build procedure written in C could cause an invalid
memory access.  (gschar.c)
	- The initial point of a band list path sometimes didn't get
written, causing excess or missing filled regions.  (gxclpath.c)
	- Characters between 49 and 56 bits wide were rendered incorrectly
when banding.  (gxclbits.c)

Renames gsimage*.c as gximage*.c, to reflect more accurately the position of
these files in the architecture.  (gsimage*.c, gximage*.c)

Fully implements the high-level bitmap image calls in the driver API.  This
includes some driver API changes; however, this part of the API was clearly
documented as not stable enough to rely on.  (gxdevice.h, gximage.h,
gdevbbox.c, gdevddrw.c, gdevnfwd.c, gsimage.c, gximage*.c)

Splits the color space header into client and implementation, as with many
others.  (gscspace.h, gxcspace.h, gximage.h, gscie.c, gscolor.c, gscolor1.c,
gscolor2.c, gscsepr.c, gsimage.c, gspcolor.c, gsstate.c, gxcmap.c,
gxpcmap.c)

Extends band lists to handle high-level images.  NOTE: This facility is
patched out because there is not yet a way to pass the necessary color
rendering information through the band list.  (gxcldev.h, gxclist.h,
gxclpath.h, gxclimag.c, gxclist.c, gxclpath.c, gxclread.c)

Implements fixed2float and float2fixed more efficiently on machines with
slow floating point.  (gxfixed.h, gscoord.c, gsmisc.c)

Makes one further NON-BACKWARD-COMPATIBLE change in the existing
higher-level driver procedures (fill_path, stroke_path, fill_mask): we make
the imager state pointer an explicit argument, rather than a member of the
gx_fill/stroke_params structure.  We now consider the specification of these
procedures stable, and have removed the "subject to change" notice from the
documentation.  (gxdevice.h, gxpaint.h, gdevbbox.c, gdevnfwd.c, gxacpath.c,
gxclpath.c, gxclread.c, gxfill.c, gxpaint.c, gxstroke.c)

Extends halftone bitmaps to include "strip" and "shift" information,
allowing halftone cells with arbitrary angles to be stored in space
proportional to the number of bits in the cell rather than the square of the
number of bits.  This requires adding new (optional) strip_tile_rectangle
and strip_copy_rop driver procedures that are like tile_rectangle and
copy_rop respectively but accept a strip bitmap rather than an ordinary
tile; these procedures supersede tile_rectangle and copy_rop (although these
also remain, defined in terms of the new ones).  This also requires making
small but NON-BACKWARD-COMPATIBLE changes in several internal interfaces.
(gdevmem.h, gdevprn.h, gsdcolor.h, gxbcache.h, gxbitmap.h, gxcldev.h,
gxclip2.h, gxclist.h, gxdevice.h, gxdevrop.h, gxdht.h, gxfcache.h,
gxhttile.h, gxpcolor.h, gzht.h; gdevabuf.c, gdevbbox.c, gdevdflt.c,
gdevm*.c, gdevmpla.c, gdevmrop.c, gdevnfwd.c, gsht.c, gsht1.c, gshtscr.c,
gspcolor.c, gsstate.c, gxcht.c, gxclbits.c, gxclip2.c, gxclist.c,
gxclpath.c, gxclread.c, gxcpath.c, gxdcolor.c, gxdither.c, gxht.c,
gximage2.c, gxpcmap.c, ...)

Adds "no join" as a line join type.  NOTE: this is not actually implemented
yet.  (gslparam.h)

Changes the initialization code so that it passes the system allocator as an
argument to module initialization procedures.  While this is theoretically a
NON-BACKWARD-COMPATIBLE change, module initialization procedures are not
documented and presumably are not used by any code outside the
implementation.  (gscdefs.h, gconf.c, gdevmrop.c, gsinit.c, gxclimag.c,
gxclpath.c)

Splits up gs_lib_init into two procedures, allowing specification of a
different default allocator for the library.  (gslib.h, gsinit.c)

Adds a resize_object operation to the allocator API.  (gsmemory.h,
gsalloc.c, gsmemory.c)

</pre>

<h2><a name="Version3.67"></a>Version 3.67 (limited) (4/12/96)</h2>

<p>
This release restructures the MS Windows and OS/2 code to be primarily DLL-
rather than EXE-based.  See under Platforms below for more news.  This
release was put out in a hurry in order to get the new DLL code into
testers' hands; it has more rough edges than usual.

<h3><a name="V3.67_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- A definition &amp; use comment was incorrect.  (scanchar.h)
	- William Bader's e-mail address was wrong.  (README)

Adds documentation for the new begin_image, image_data, and end_image
procedures.  THIS INTERFACE IS STILL SUBJECT TO CHANGE.  (drivers.doc)

</pre><h3><a name="V3.67_Procedures"></a>Procedures</h3><pre>

Renames all the *core.dev modules as *lib.dev.  (int.mak, *lib.mak, vms.mak,
gdevmrop.c)

Updates all the remaining makefiles to IJG JPEG version 6a.  (*.mak)

Moves the configuration parameter definitions from gconf.c to a new file
gscdefs.c.  (bcwin*.mak, *lib.mak, gs.mak, int.mak, lib.mak, unixtail.mak,
vms.mak, gconf.c, gscdefs.c)

</pre><h3><a name="V3.67_Platforms"></a>Platforms</h3><pre>

Restructures the MS Windows and OS/2 code to be primarily DLL- rather than
EXE-based.  This involves two minor NON-BACKWARD-COMPATIBLE changes to the DLL
interface, documented near the end of dll.doc:

	- Adding argv and argc as arguments to gsdll_init.

	- Adding a new message type, GSDLL_POLL, to the callback procedure.

(bcwin*.mak, devs.mak, os2.mak, dll.doc, install.doc, dw*.*, gsdll*.*,
gdevms*.*, gdevpm.c, gdevw*.c, gp_mswin.c, gp_os2.c, gsos2.def, gswin.rc)

Adds the BMP drivers to the Watcom platform.  (watc.mak)

</pre><h3><a name="V3.67_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- gs.c assumed the presence of stdio.  (gs.c)

Defines a new API entry point that is the equivalent of command line
invocation.  (imain.h, imainarg.h, gs.c)

Changes clients to conform to the changes in gsimage.h.  (zimage2.c,
zpaint.c)

Speeds up the search operator slightly.  (zstring.c)

</pre><h3><a name="V3.67_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- If the PDF interpreter was present, running a PostScript file
didn't close the file properly if it caused an error.  (pdf_main.ps)

Speeds up embedded font loading by making an internal buffer bigger.
(pdf_font.ps)

</pre><h3><a name="V3.67_Library"></a>Library</h3><pre>

Fixes bugs:
	- There could be some non-zero garbage between the width and the
next multiple of bitmap_align_mod for copy_alpha.  (The driver API
specification explicitly allows this, but it upset one customer.)
(gxccman.c)
	- Nibble-swapped alpha values could be displaced in memory by one
pixel, damaging the output.  (gdevabuf.c)

Makes further changes towards adding high-level bitmap image calls to the
driver API.  This includes the following minor NON-BACKWARD-COMPATIBLE
changes to the interface defined in gsimage.h:

	- changing MultipleDataSources from a member of the gs_image_t
	structure to an argument of gs_image_init;

	- changing the default image parameter values from constant
	structures to procedures that initialize the structure.

As far as we know, this doesn't affect any existing client code.
(gsimage.h, gsiparam.h, gxdevice.h, gdevddrw.c, gdevnfwd.c, gsimage.c,
gspcolor.c, gxccache.c)

Removes an unnecessary level of call for path filling.  (gxpaint.h,
gxfill.c, gxpaint.c)

</pre>

<h2><a name="Version3.66"></a>Version 3.66 (limited) (4/8/96)</h2>

<p>
This release adds support for TrueType fonts and Type 42 (encapsulated
TrueType) PostScript fonts.  The MS Windows driver now interacts properly
with the garbage collector.  This release also includes a new, high-quality
set of free fonts.

<h3><a name="V3.66_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The list of generic makefiles had gotten out of date.  (make.doc)

Adds a mention of the bmv program, created by a user and available under the
GPL.  (README)

Notes that a bug in gcc 2.7.x prevents these versions from compiling
Ghostscript.  (make.doc)

Clarifies the meaning of "inverted" masks.  (gsimage.h)

Improves the documentation of the stack sizing parameters.  (interp.c)

Improves the documentation of the copy_rop driver procedure.
(drivers.doc)

Notes that all subclasses of gx_device must explicitly include the
device_finalize finalization procedure.  (gxdevice.h)

Updates the documentation of the high-level driver API to reflect the change
in gx_drawing_color, and the addition of the new polygon and image drawing
procedures.  (drivers.doc)

Updates the documentation for building zlib and libpng.  (make.doc)

</pre><h3><a name="V3.66_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The environment space overflowed on some inferior Unix systems.
(unixtail.mak)

Adds a ttfont.dev "feature" for including the TrueType interpreter and the
ability to handle Type 42 fonts.  A new procedure, .loadttfont, allows
loading a TrueType font directly (by converting it to a Type 42 on the fly).
(gs.mak, int.mak, lib.mak)

Updates the makefiles and procedures to libpng 0.88 and zlib 1.0.
(libpng.mak, zlib.mak)

</pre><h3><a name="V3.66_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- pdf2ps could produce lines longer than 255 characters.
(pdf_2ps.ps)

Removes some unnecessary and error-inviting code from pdf2dsc.  (pdf2dsc.ps)

Updates lines.ps to test the new stroke code more fully.  (lines.ps)

Allows omitting the second argument of ps2pdf, as for ps2epsi.  (ps2pdf)

</pre><h3><a name="V3.66_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- A routine was incorrectly declared "private".  (I wish gcc caught
this!)  (gdevpdf.c)
	- A 'const' was omitted in a parameter list.  (gdevpdfp.c)
	- Some imported procedures didn't have prototypes declared.
(gdevpdft.c)
	- The ProcSet list for PDF files didn't include Text when it was
needed.  (gdevpdfx.h, gdevpdf.c, gdevpdft.c)
	- Text in PDF output ignored the color setting.  (gs_pdfwr.ps,
gdevpdft.c)
	- Text in PDF output could be positioned incorrectly.  (gdevpdft.c)
	- pdfmarks could produce an error when producing PDF output.
(gs_pdfwr.ps)

Slightly improves the text output of the PDF writer.  (gs_pdfwr.ps,
gdevpdft.c)

Defines driver procedures for filling trapezoids (with the parallel edges
parallel to a coordinate axis), parallelograms (with arbitrary orientation),
triangles (ditto), and minimum-width lines (ditto).  (Note that the last of
these obsoletes the former draw_line procedure.)  (gdevmem.h, gdevprn.h,
gxdevice.h, gxdraw.h (deleted), gdevddrw.c, gdevdflt.c, gdevht.c,
gdevnfwd.c, gsimage[12345].c, gxacpath.c, gxclist.c, gxclip2.c, gxcpath.c,
gxdraw.c (deleted), gxfill.c, gxpcmap.c, gxstroke.c)

Adds "sketched" driver procedures for high-level bitmap / pixmap image
drawing.  In this release, the argument lists are incomplete, and the
procedures are stubs: don't try to use them!  [see previous entry]

Changes the screen update strategy for the X Windows driver from a
compile-time option to a settable run-time variable.  (gdevx.c)

Patches around a problem with libpng 0.88 that can't be fixed without
editing a configuration file.  (gdevpng.c)

</pre><h3><a name="V3.66_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- %g formats with sscanf don't work on NeXT systems.  (gdevpdft.c,
iutil.c, zdouble.c)
	- getenv could be declared inconsistently.  (gp_unix.c)

</pre><h3><a name="V3.66_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- The Type 1 font interpreter sometimes set the flatness too large.
(gstype1.c)
	- Fonts defined by definefont could never be garbage collected.
(gsstruct.h, gxfcache.h, gxfont.h, gxfont0.h, gxfont1.h, gsfont.c,
gsfont0.c)
	- Type 0 fonts weren't garbage collected properly.  (gsfont0.c)
	- Compiled fonts caused a compilation error (bug introduced in
3.65).  (ifont.h)
	- If a Type 1 font used hint replacement, hints could be applied
more than once, distorting the character shape.  (gxtype1.h, gxhint3.c)
	- Oversampling wasn't applied to large enough characters.
(gschar.c)

</pre><h3><a name="V3.66_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The scanner accepted /[, /], /&lt;&lt;, and /&gt;&gt; as literal names (and
similarly for //).  It isn't obvious from the Red Book, but the Adobe
implementations don't accept these.  What a nuisance!  (gs_btokn.ps,
gs_init.ps, pdf_2ps.ps, pdf_base.ps, pdf_main.ps, iscan.c)
	- A spurious stackoverflow could occur under unusual conditions.
(istack.c)
	- The values of OrigFont and ScaleMatrix in scaled fonts reflected
only the most recent scaling operation, not the original font and the
combined scaling operation.  (zfont.c)
	- The default size of systemdict had become slightly too small.
(iinit.c)
	- Type 1 characters defined by PostScript procedures were called
incorrectly.  (zcharout.c)

Removes the papersize operator from statusdict, since it is not documented
anywhere in the Adobe literature and didn't interact properly with the
various ways of setting the page size.  (gs_statd.ps)

Changes the one client of sskip to match the changed API.  (zpaint.c)

Changes clients to reflect the creation of sstring.h.  (iscan.h, zfilter.c)

Adds PSStringEncode as an accessible filter.  (zfilter.c)

Adds support for TrueType and Type 42 fonts.  (gs_fonts.ps, gs_ttf.ps,
gs_typ42.ps, bfont.h, icharout.h, ifont.h, zchar1.c, zchar42.c, zcharout.c,
zfont1.c, zfont2.c, zfont42.c)

Adds a few ANSI sheet sizes (commented out, for documentation only).
(gs_statd.ps)

</pre><h3><a name="V3.66_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Clients who called pdfopen/close rather than runpdf could get an
error (PSLevel1 undefined).  (pdf_main.ps)
	- Some masked images were displayed with black and white inverted.
(gs_pdf.ps)
	- In Level 1 output produced by pdf2ps, images caused a syntaxerror.
(gs_pdf.ps)
	- If a PDF file had multiple xref sections and later sections added
new objects, an error occurred.  (pdf_main.ps)
	- Some very old Level 1 interpreters couldn't deal with a file
object embedded in a procedure.  (gs_pdf.ps)

</pre><h3><a name="V3.66_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The PSStringEncode filter didn't always produce printable 7-bit
output.  (sstring.c)
	- The CCITTFaxDecode filter didn't implement DamagedRowsBeforeError.
(scfx.h, scfd.c)
	- Interpolated images displayed nothing if the data stream ended
before the image height was reached.  (siscale.h, gsimage5.c, siscale.c)

Changes the sskip stream procedure so that it takes an additional argument
where it returns the actual number of bytes skipped.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE in the API.  However, as far as we know,
there are no external clients of this procedure.  (stream.h, stream.c)

Splits up sfilter.h so that the headers correspond more directly with the
implementations.  (sfilter.h, sstring.h, sstring.c)

</pre><h3><a name="V3.66_Library"></a>Library</h3><pre>

Fixes bugs:
	- The default device in the library configuration was device 1, not
device 0.  (bclib.mak, ugcclib.mak, watclib.mak, gslib.c)
	- Patterns could be rendered with small gaps between them.
(gspcolor.c)
	- Large characters could render inaccurately because of a numerical
boundary condition.  (gxpcopy.c)
	- The show_gstate pointer in the graphics state was not managed
properly, possibly leading to dangling pointers or GC errors.  (gsstate.c)
	- Bitmaps could get shifted to the left if ALPHA_LSB_FIRST was
selected (bug introduced in 3.53).  (gsbitops.c)
	- The garbage collector could move devices in memory, causing
problems with command list devices.  (gxdevice.h, gsdevice.c)

Continues restructuring the image handling code in preparation for adding a
high-level driver operation.  (gsimage[12345].c)

Starts to implement passing color mapping information (transfer function,
black generation, undercolor removal, CRD, halftoning) in the band list.
(gxfmap.h, gscolor.c, gscolor1.c, gsht1.c, gsstate.c)

Speeds up the path filling code a little more.  (gxdraw.c)

Removes the workaround for the gcc 2.7.0/1/2 optimizer bug, since this
turned out to cause more trouble than it was worth.  (stdpre.h)

Speeds up stroking dramatically for the case of butt or square caps, bevel
or beveled miter joins, and no fill adjustment, by filling parallelograms
and triangles directly rather than constructing and filling paths.  This is
an important common case for CAD drawings.  (gxdraw.h, gxdraw.c, gxstroke.c)

Adds support for TrueType and Type 42 fonts.  (gxfont.h, gxfont42.h,
gstype42.c)

Extends the memory manager to allow allocating objects that the garbage
collector won't move.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE for
implementors of memory managers, but clients aren't supposed to have any of
these.  (gsmemory.h, gsmemory.c, gsalloc.c)

Makes dynamically created instances of registered devices immovable.
(gsdevice.c)

Unifies gx_drawing_color with (makes it equivalent to) gx_device_color.
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE for implementors of the
higher-level driver procedures (fill_path, stroke_path, fill_mask).  We
regret that this was necessary, but the documentation in drivers.doc does
warn the reader: "DO NOT ASSUME THESE OPERATIONS WILL REMAIN UNCHANGED IN
FUTURE RELEASES."  These three procedures, at least, should now be stable.
(gsdcolor.h, gxcindex.h, gxdcolor.h, gxdevice.h, gximage.h, gxpaint.h,
gxpcolor.h, gdevdflt.c, gdevpdf.c, gdevpdfi.c, gdevxalt.c, gsimage.c,
gsimage2.c, gspcolor.c, gxacpath.c, gxccache.c, gxcht.c, gxclpath.c,
gxclread.c, gxdcconv.c, gxdither.c, gxfill.c, gxdraw.c, gxht.c, gxpaint.c,
gxpcmap.c, gxstroke.c)

</pre>

<h2><a name="Version3.65"></a>Version 3.65 (limited) (3/9/96)</h2>

<p>
This release adds garbage collection for device instances.  ****** NOTE:
Because of changes in memory management, if you are using the MS Windows
driver (mswin), you must run with -dNOGC.  This is a temporary problem which
will be fixed before the next beta release.

<h3><a name="V3.65_Documentation"></a>Documentation</h3><pre>
Documents the C API equivalent of a -d switch for setting a flag like
NOPAUSE.  (imain.h)

Splits off the NEWS entries for versions 3.0 through 3.33 into a new
file.  (history3.doc)

Adds a man page for ps2pdf.  (ps2pdf.1)

Documents the new memory management aspects of device drivers, and corrects
many other aspects of driver documentation that had become inaccurate.
(drivers.doc)

Updates the documentation for the gs_*.ps files.  (psfiles.doc)

Replaces .type1addpath with .type1execchar.  (language.doc)

Adds some more documentation on how band lists do read/write switching.
(gxclist.h)

Adds a reference to the new Genscript program, a free Ghostscript-based
replacement for enscript.  (README)

Notes that no further changes will be accepted for the gdevcdj.c file, which
has gotten completely out of hand.  (gdevcdj.c).

Documents the TextAlphaBits and GraphicsAlphaBits device parameters.
(language.doc)

</pre><h3><a name="V3.65_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- gs_pdfwr.ps and pdf2ps.1 weren't installed on Unix systems.
(unix-end.mak)
	- The pdf2ps shell script didn't accept any options.  (pdf2ps)
	- The rule for srle.$(OBJ) incorrectly specified a dependency on
srld.c.  (lib.mak)
	- The rule for command lists didn't include stream.$(OBJ).
(lib.mak)
	- The stack size for one configuration was set too small.
(watclib.mak)

Speeds up genconf by eliminating redundant file reading and processing.
(genconf.c)

Moves the pixel-difference filters from int.mak to lib.mak.  (int.mak,
lib.mak)

Moves the library parts of the HSB color and Level 1 path (arcs, pathbbox,
path enumeration) options from int.mak to lib.mak, and adds them to the
library makefiles.  (int.mak, lib.mak; bclib.mak. ugcclib.mak, watclib.mak)

</pre><h3><a name="V3.65_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- pdf2ps would fail if it encountered a font with a standard
encoding.  (pdf_2ps.ps)

Adds new switches to pdf2ps:
	-dPSBinaryOK allows writing binary image data in the output.
(pdf_2ps.ps)
	-dPSLevel1 forces Level 1 compatible output.  (int.mak,
unix-end.mak, gs_l2img.ps, gs_pdf.ps, pdf_2ps.ps, pdf_main.ps)
	-dPSNoProcSet causes the ProcSet to be loaded at run time, not at
conversion time -- primarily useful for debugging.  (pdf_2ps.ps)

Adds a utility for viewing PCX files, so we can preview high-resolution
output in a reasonable compressed format.  (unix-end.mak, viewpcx.ps)

</pre><h3><a name="V3.65_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Some compilers require an extra #include to define structures even
if they are only referenced by pointers.  (int.mak, gdevpdf.c, gdevpdfp.c)
	- A procedure name was duplicated.  (gdevpdfi.c)
	- A pdfmark between a gsave and a grestore could cause a
rangecheck error.  (gdevpdfp.c)
	- A pdfmark between a gsave and a grestore could cause the
grestore to do an inappropriate initgraphics.  (gs_pdfwr.ps)
	- The pdfwrite driver could reinitialize the output file
unpredictably.  (gdevpdfp.c)
	- The PCX drivers didn't clear padding bytes at the ends of scan
lines.  (gdevpcx.c)
	- The PCX drivers didn't set the "version" field correctly (this was
OK in 2.6.1, bug introduced sometime since then).  (gdevpcx.c)
	- Whoever last touched the color inkjet drivers completely broke the
handling of the BitsPerPixel parameter, again.  We were able to half-fix it,
but the code is impossible to understand, let alone modify safely.
(gdevcdj.c)
	- Anti-aliased characters didn't work with banding.  (gxclpath.c)
	- The PGM/PPM drivers didn't recognize black-and-white pages for
optimization to PBM, only gray or colored.  (gdevpbm.c)
	- The color inkjet drivers initialized the params_size field of the
static instance incorrectly, resulting in garbage in the last few structure
members when instances were copied.  (gdevcdj.c)
	- The 24-bit PCX driver didn't pad each scan line to an even number
of bytes.  (gdevpcx.c)
	- The svga16 driver initialized its procedures incorrectly.
(gdevpcfb.c)

Adds text writing capability to the PDF writer.  In its present form, this
is a very bad hack: it only works for the 14 built-in fonts with their
standard encodings.  (gdevpdfx.h, gdevpdf.c, gdevpdfp.c, gdevpdft.c)

Adds garbage collection and finalization for device instances (gscdefs.h,
gsdevice.h, gxdevice.h, gconf.c, gdevmrop.c, gsdevice.c, gslib.c, gsmain.c).
(See the "Driver instance allocation" section of drivers.doc for more
details about what is required to make this work.)

	- When an open device is freed (explicitly, by garbage collection,
or by 'restore'), if the device was allocated dynamically by Ghostscript's
standard allocator, the device's close procedure will be called.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE for dynamically created devices, which
formerly were not closed automatically, even when Ghostscript exited.

	- Device instances allocated in GC-able space will be traced
like other objects, assuming they have proper structure descriptors.

Provides a (very slow but correct) default implementation of copy_alpha.
(gxcindex.h, gdevdflt.c, gsimage4.c)

Removes the implementation of copy_alpha in gdevpbm.c, since this is now
implemented (more efficiently) in gdevm24.c.  (gdevpbm.c)

Adds TextAlphaBits and GraphicsAlphaBits as readable parameters for all
devices.  (gsdparam.c, gdevpbm.c, gdevsvga.c)

</pre><h3><a name="V3.65_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- There were some attempts to coerce long to short pointers
on segmented platforms.  (gsdparam.c, gstype1.c)
	- The stack could overflow on the 16-bit MS Windows platform.
(gxfill.c, gxclread.c)
	- The DLL callback parameter for window resize events was computed
incorrectly on 16-bit systems.  (gdevwdib.c)
	- A file included gxdevice.h unnecessarily.  (bcwin.mak,
bcwin32.mak, msvcwint.mak, gp_mswin.c)

</pre><h3><a name="V3.65_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Storing into a read-only dictionary with def or store was
allowed.  (dstack.h)
	- If the interpreter allocated extra space for a dictionary
to round its storage size up to a power of 2, it was possible for
length to exceed maxlength.  (idict.c, iinit.c)
	- The if and ifelse operators didn't check that their
'procedure' arguments were actually procedures.  (interp.c, zcontrol.c)
	- The undef operator was defined even in Level 1
configurations.  (We need this capability for all configurations, so
we always define .undef.)  (zdict.c, gs_*.ps, pdf_*.ps)
	- In Level 1 configurations, copying a dictionary should copy the
access attributes, but it didn't.  We have to work around this
compatibility quirk in a lot of places.  (gs_cidfn.ps, gs_cmap.ps,
gs_dps1.ps, gs_fonts.ps, gs_init.ps, gs_l2img.ps, gs_lev2.ps, gs_pdf.ps,
gs_pfile.ps, gs_res.ps, gs_setpd.ps, gs_type1.ps, zdict.c)
	- DSC comments that crossed a buffer boundary didn't call the
scan_dsc_proc.  (iscan.c)
	- "statusdict /setpage get exec" caused an error.  (gs_statd.ps)
	- The default size of systemdict had become slightly too small.
(iinit.c)
	- Doing a showpage or copypage would cause the equivalent of a
setpagedevice at the next restore or grestore.  We aren't entirely sure that
the fix we made doesn't have bad side-effects.  (gs_setpd.ps)
	- Not all filters accepted (and ignored) an optional dictionary
parameter on the stack.  (ifilter.h, zfbcp.c, zfdecode.c, zfilter.c,
zfilterx.c, zfzlib.c, zmisc1.c)
	- The PixelDifference filters required a Columns parameter, rather
than defaulting it to 1.  (spdiffx.h, zfdecode.c)
	- Contrary to the NEWS entry for release 3.60, the LZW filters did
not implement pixel differencing.  (zfdecode.c, zfilter2.c)
	- readstring with a 0-length string didn't signal a rangecheck.
This doesn't make a lot of sense to me, but it's what the Adobe
documentation specifies.  Unfortunately, we have to work around this in a
number of places that assumed the sensible definition (return () true
without reading anything).  (gs_l2img.ps, pdf_font.ps, zfileio.c)
	- Encoded number strings didn't work (bug introduced in 3.64).
(ibnum.c)
	- The allocator could produce spurious "free large 0x...... chunk
not found" messages.  (These didn't cause any harm, but they were
disturbing.)  (gsalloc.c)

Changes the default transfer function for high-resolution devices so
that it is the identity function if the device is continuous-tone.
(gs_init.ps)

Undoes the "subversion" of zgetdevice noted in release 3.61, since it
is now possible to copy devices safely.  (zdevice.c)

Changes the implementation of the garbage collector and restore so that
object finalization code may safely free objects.  (igc.c, isave.c)

Reimplements essentially all of Type 1 BuildChar in C.  (gs_init.ps,
gs_type0.ps (deleted), gs_type1.ps, ifont.h, zchar.c, zchar1.c, zfont.c)

Reimplements DISKFONTS as a separate feature (diskfont.dev), and changes it
to use Type 4 fonts rather than special machinery.  Currently this feature
is included only in the makefiles for 16-bit architectures.  (bc.mak,
bcwin.mak, int.mak, tc.mak, gs_diskf.ps, gs_fonts.ps, gs_type1.ps)

Converts the library search path from a list of strings to a (PostScript)
array of strings, one string per directory.  (iminst.h, main.h, gs.c,
gsmain.c, zfile.c)

Adds a hook procedure scan_comment_proc for processing all comments,
similar to scan_dsc_proc.  If both are set, scan_comment_proc is used only
for non-DSC comments.  (iscan.h, iscan.c)

</pre><h3><a name="V3.65_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Encrypted PDF files produced a random error (usually ioerror in
--token--) rather than a meaningful message.  (pdf_main.ps)
	- Color space setting didn't work.  (gs_pdf.ps)
	- The algorithm for skipping a possible blank line following the
'stream' keyword wasn't robust enough.  (We aren't sure the new algorithm is
exactly right, either.)  (pdf_base.ps)

Gets rid of the special handling of the LZW decoding filter, since the
filter itself now handles the Predictor facility.  (pdf_base.ps)

</pre><h3><a name="V3.65_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- Configurations with LZW encoding but not decoding had an
undefined reference.  (lib.mak, slzwc.c, slzwd.c)
	- The LZW-compatible encoder didn't provide a 'reset' procedure.
(slzwce.c)
	- The PixelDifference filters didn't work for most parameter
combinations in which each pixel took up more than 1 byte.  (spdiff.c)
	- Temporary write streams could cause an infinite loop.  (We only
need such streams for the Predictor = 2 case of LZWEncode: this is why the
bug never showed up before.)  (stream.c)

Adds an optional reinitialization procedure to the stream template.  Note
that this is not the same as the PostScript 'reset' operation or the stream
resetting operation invoked by sreset: the reinit procedure in the template
reinitializes any internal state of the encoder or decoder without affecting
buffered data.  (scommon.h, strimpl.h, sbcp.c, sbhc.c, slzwce.c, slzwd.c,
slzwe.c, smtf.c, spdiff.c, srle.c) ****** NOT DONE YET: sbwbs.c, szlibd.c,
szlibe.c

Adds a decoding stream for the run-length compression used in PCX.
(spcxx.h, spcxd.c)

</pre><h3><a name="V3.65_Library"></a>Library</h3><pre>

Fixes bugs:
	- A recent edit introduced an extraneous right parenthesis.
(gpcheck.h)
	- A minor nit in a macro could cause incorrect grouping of 'if'
statements under implausible conditions.  (gsmdebug.h)
	- The first data plane buffer of an image enumerator didn't get
marked during garbage collection.  (gsimage.c)
	- The Watcom C compiler required splitting up a declaration.
(gxcmap.h)
	- The extern declarations for the tables in gconf.c weren't gathered
together in one place.  (gscdefs.h, gxiodev.h, gconf.c, gsdevice.c, gslib.c,
gsinit.c, gsiodev.c)
	- charpath and show produced different output.  We fixed this by
undoing a "bug fix", introduced in version 2.9, which suppressed hinting and
coordinate rounding for charpath; we aren't sure this won't cause some
obscure problems to reappear.  (gstype1.c)
	- Clipping with a rectangle usually created a 3-rectangle clipping
list, slowing down all drawing operations (performance bug only).
(gxacpath.c)
	- stroking in a rotated coordinate system sometimes thought lines
were always thin when they actually weren't.  (gxstroke.c)
	- An unsigned quantity wasn't properly converted to signed, possibly
causing band path coordinates to get mangled.  (gxclread.c)
	- A bug in the Borland compiler caused an unsigned quantity to be
interpreted as signed, causing band path coordinates to get mangled.
(gxclread.c)

Changes structure type pointers on 16-bit segmented systems to full
32-bit pointers.  This will increase time and space requirements very
slightly on these systems.  (gsmemory.h, gxobj.h)

Changes the memory manager so that object finalization code may safely free
objects.  (gsmemory.h, gsstruct.h, gsalloc.c, gsmemory.c)

Refactors the Type 1 CharString interpreter so it can be included in
the imager library.  (gstype1.h, gxtype1.h, gstype1.c)

Starts to refactor the implementation of band lists in memory so that it can
use any encoding/decoding filter.  Currently this choice is made at compile
time, but it could easily be made dynamic.  (gxclmem.h, gxclmem.c)

Starts to refactor image rendering so that, like path filling and stroking,
it only uses imager state and can be done after banding.  (gxcmap.h,
gxdraw.h, gximage.h, gsimage*.c, gxcmap.c)

Speeds up copy_mono for 2-bit-per-pixel devices a little.  (gdevm2.c)

Implements an optimized copy_alpha for 24-bit memory devices.  (gdevmem.h,
gdevm24.c)

Speeds up filling rectangles significantly.  (gsbitops.c)

Changes the band list rasterizer to use the memory space of the device
rather than the C heap: our allocator is considerably faster than malloc.
(gxclread.c)

Speeds up stroking a little, especially in 90 degree rotated coordinate
systems.  (gxstroke.c)

</pre>

<h2><a name="Version3.64"></a>Version 3.64 (limited, incremental) (1/27/96)</h2>

<p>
This release fixes a few more bugs, including some serious bugs in band
lists, and adds pdfmark processing to the PDF writer.  The PDF writer is
still not fit for real use, since it converts all text characters into 720
dpi bitmaps and turns images into zillions of tiny rectangles (!), but it
should be producing legal output.

<h3><a name="V3.64_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- Frans van Hoesel's e-mail address was incorrect.  (gdevdjet.c)
	- The man page for ansi2knr was out of date.  (ansi2knr.1)
	- The description of a procedure was out of date.  (gxdcolor.h)

Notes that several "optional" features are required in order to obtain the
full PostScript Level 1 functionality at the library level.  (lib.doc)

Documents the top-level interpreter API.  (imain.h)

Adds details on differences between the imager API and the PostScript
graphics operators.  (lib.doc)

Notes (here, in NEWS) that the change for device prototypes in 3.61 made the
protection attributes of a device significant for the first time.  Only the
writable attribute is significant so far.  (news)

</pre><h3><a name="V3.64_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The .dev rules in the library makefiles didn't list echogs as a
dependency.  (jpeg.mak, libpng.mak, zlib.mak)
	- The install rule tried to install gs.1.1 etc. rather than gs.1
etc.  (unix-end.mak)
	- The install rule tried to install some nonexistent *.1 files.
(unix-end.mak)

Adds 'help' and '?' procedures to assist users who don't read the
documentation.  (gs_init.ps)

Adds -A-, -E-, and -Z-... to turn off debugging flags.  (gs.c)

Adds a -dDELAYBIND switch to delay binding operators, to allow special
packages like pstotext to redefine them.  (gs_init.ps)

</pre><h3><a name="V3.64_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- Fonts produced by rollconv.ps left a couple of items on the
operand stack, and left array packing set to true.  (rollconv.ps)

Makes ansi2knr require that the first token after a function header be a
left brace on the next line, so it can cope with some macros in IJG release
6a.  Also updates it to work better without the GNU configure machinery, and
on some old compilers.  (ansi2knr.c)

Changes align.ps so it can be used directly to determine the margin
parameters.  (align.ps, psfiles.doc)

</pre><h3><a name="V3.64_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The TIFF/F (G3 and G4) drivers were broken (bug introduced in
3.60).  (gdevtfax.c)
	- The PDF writer produced invalid output for 0-width, 0-height
images.  (gdevpdfi.c)
	- The PDF writer wasn't a page device.  (gdevpdf.c)
	- The PDF writer assigned the Contents node rather than the Pages
node as the Parent of each page.  (gdevpdfx.h, gdevpdf.c)

Corrects the margin information for the DeskJet printers to be the actual
values observed on a printer; all of the values in the file were wrong.
(gdevdjet.c)

Adds pdfmark recognition and conversion to the PDF writer.  All documented
pdfmarks (ANN, ARTICLE, DEST, DOCINFO, DOCVIEW, LNK, OUT, PAGE, PAGES, PS)
are recognized and converted, but some of them are not converted correctly.
(gs_pdfwr.ps, gdevpdfx.h, gdevpdf.c, gdevpdfm.c)

Adds recognition of all Distiller parameters, except *ImageDict, to the PDF
writer.  Currently only ASCII85EncodePages actually has any effect.
(gs_pdfwr.ps, gdevpdfx.h, gdevpdfp.c)

Ensures that PDF output files include at least a default Info dictionary.
(gdevpdf.c)

Changes the handling of coordinates in PDF output files so that the scale is
always 72 dpi, and so that each graphics operator is on a line by itself,
for compatibility with Adobe Illustrator.  (gdevpdfx.h, gdevpdf*.c)

Adds a driver for ImageMagick's MIFF format.  The driver currently only
produces 24-bit, direct color, RLE compressed output.  (gdevmiff.c)

</pre><h3><a name="V3.64_Platforms"></a>Platforms</h3><pre>

Changes the gp_check_interrupts platform procedure so that instead of just
returning a Boolean, it can now also return a negative error code.  THIS IS
(THEORETICALLY) A NON-BACKWARD-COMPATIBLE CHANGE.  However, since all
implementations of this procedure should only have been returning 0 or 1 up
to now, no existing code should need to be changed.  (gpcheck.h, gsmisc.c)

</pre><h3><a name="V3.64_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- devicenames was accidentally deleted.  (gs_init.ps)
	- -dFAKEFONTS could cause the memory manager to waste a lot of time.
(gs_dps1.ps)
	- Using -r or -dFIXEDMEDIA with a non-page device caused an error.
(gs_init.ps)
	- A VMS compiler reserves the word "readonly", which was used as a
parameter name.  (imain.h, gsmain.c)
	- A garbage collection during the execution of x/y/xyshow with an
array providing the values could get confused.  (ibnum.h, ichar.h, stream.h,
ibnum.c, iscanbin.c, zchar.c, zchar2.c, zdps1.c, zupath.c)
	- Errors in encoded number strings produced a typecheck rather than
a rangecheck error.  (ibnum.c, zupath.c)

Updates the DCT filters for IJG release 6a.  (zfdctc.c)

Provides an API call for getting the real stdio files.  (imain.h,
gs.c, gsmain.c)

</pre><h3><a name="V3.64_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- If the CCITTFaxEncode stream encountered an output buffer boundary
while processing the last scan line of input, it could fail to process some
the scan line.  (scfe.c)
	- A couple of pointers weren't always initialized, possibly
confusing the garbage collector.  (stream.c)
	- The weighting coefficient structures used for image scaling
weren't declared properly for the garbage collector.  (siscale.h, siscale.c)

</pre><h3><a name="V3.64_Library"></a>Library</h3><pre>

Fixes bugs:
	- Unrotated patterns always used the bounding box size as the step,
rather than XStep/YStep.  (gspcolor.c)
	- Alpha computations for graphics could be seriously incorrect (bug
introduced in 3.6x).  (gdevabuf.c)
	- The length of the next_data_x command for the fill_mask operation
was incorrect, causing the band list to become confused (bug introduced in
3.63).  (gxclpath.c)
	- An extern was omitted, causing linker warnings.  (gxdevice.h)
	- RasterOps could cause an invalid access because the palette
for a memory device wasn't set.  (gdevmrop.c)
	- gximage.h was included unnecessarily.  (gspaint.c)
	- Color screens caused a segmentation fault (bug introduced in
3.6x).  (gxcht.c)
	- cshow returned the width in an incorrect coordinate system.
(gscoord.h, gschar.c)
	- Filling or stroking a path that lay entirely off the page in the
+X or +Y direction could corrupt memory (bug introduced in 3.6x).
(gxclpath.c)
	- When banding, painting characters with halftones produced random
results (bug introduced in 3.6x).  (gxclpath.c)
	- When banding, characters could get clipped when they shouldn't be
(bug introduced in 3.6x).  (gxclpath.c)
	- The default implementation of fill_mask could discard clipped
bitmaps (bug introduced in 3.6x).  (gdevdflt.c)
	- Non-halftoned 24-bit colors could get garbled when banding (bug
introduced in 3.6x).  (gxclist.c)
	- When banding, if a stroked path had subpaths that fell entirely
outside the current band, the rest of the path was drawn in the wrong place
(bug introduced in 3.6x).  (gxclpath.c)

Speeds up image interpolation on machines with slow floating point.
(siscale.h, siscale.c)

Speeds up interpolated images when using device color spaces.  (gxcvalue.h,
gxfrac.h, gdevht.c, gxcmap.c, gsimage.c, gsimage3.c)

Speeds up color mapping a little by removing tests and calls in favor of
code copying.  (gxcmap.c)

Implements RasterOp for 24-bit RGB devices.  (gdevm8.c, gdevm24.c,
gdevmrop.c)

</pre>

<h2><a name="Version3.63"></a>Version 3.63 (limited, incremental) (1/14/96)</h2>

<p>
This release has the usual collection of bug fixes, and two significant
additions: AccurateScreens, and the first draft of a PostScript-&gt;PDF
converter ("distiller").

<h3><a name="V3.63_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- Some documentation for pstoppm.ps was out of date.  (psfiles.doc)
	- Documentation for acctest.ps, view*.ps, and zeroline.ps was
missing.  (psfiles.doc)
	- The documentation for rollconv.ps omitted the .CSR file.
(rollconv.ps)

Removes an inappropriate RCS Id line.  (gs.1)

Adds a list of paper sizes to the man page.  (gs.1)

Suggests that driver authors use parameterization rather than copying when
possible.  (drivers.doc)

Adds an announcement of Ghostscript support on CompuServe.  (README)

Documents the new -dCOLORSCREEN switch and the existing -dDITHERPPI=lpi
switch.  (use.doc)

Notes that the OS/2 implementation now requires EMX/GCC 0.9b rather than
0.9a.  (install.doc)

Adds some new man pages.  (pdf2ps.1, ps2ascii.1)

Greatly expands lib.doc.  (lib.doc)

</pre><h3><a name="V3.63_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The pg target for Unix platforms didn't include some necessary
additional X11 libraries.  (unix-end.mak)
	- The Unix library makefile didn't define CCAUX or CCLEAF.
(ugcclib.mak)
	- Unix systems didn't `install' some .ps files.  (unix-end.mak)

Extends genconf so that features at the library level can have
initialization procedures.  (gconf.c, genconf.c, gsinit.c)

Adds a -dCOLORSCREEN[=false] switch to force enabling or disabling of
4-color screens.  (gs_init.ps, gs_setpd.ps)

</pre><h3><a name="V3.63_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- The prfont utility didn't leave enough of a margin on the left.
(prfont.ps)
	- The ps2ascii utility still created files _temp_.out and _temp_.err
even though they are no longer used.  (ps2ascii.ps)
	- The acctest.ps file was empty, rather than including a test
program.  (acctest.ps)

Adds ps2pdf[.bat] scripts for invoking the new pdfwrite driver.  (ps2pdf,
ps2pdf.bat, unix-end.mak)

</pre><h3><a name="V3.63_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The x11alpha driver had a patch that suppressed output in many
cases.  (gdevxalt.c)
	- The X driver set up a parameter incorrectly in copy_color.
(gdevx.c)
	- An explicit cast was needed to handle a 'const' problem.
(gdevpng.c)

Adds a pdfwrite driver that creates syntactically correct PDF output.  The
output is only reasonable for fill/stroke graphics, not for text or images.
(iscan.h, sa85x.h, sfilter.h, gdevpdf.c, sfilter2.c, zfdecode.c)

</pre><h3><a name="V3.63_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The test for WinExec failure on Win32 was incorrect.  (gp_mswin.c)
	- getenv was declared redundantly on OS/2.  (gp_os2.c)
	- gs16spl.c was missing &lt;string.h&gt;.  (gs16spl.c)

</pre><h3><a name="V3.63_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Images read data in smaller and smaller increments (performance
bug only).  (zpaint.c)
	- Images with MultipleDataSources=true and two or more DataSources
referencing the same stream could get confused.  (zpaint.c)
	- Invoking setpagedevice with an undefined key, even with Policy =
1, caused an error.  (gs_setpd.ps)
	- IEEE floats in binary tokens or encoded number strings were read
incorrectly on CPUs that use non-IEEE floating point.  (ibnum.c)

Adds a 'const' to the second parameter of zimage_setup.  (zimage2.c,
zpaint.c)

Encapsulates the filling of free memory blocks in a macro.  (igc.c,
igcstr.c)

</pre><h3><a name="V3.63_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- If the first line of a file began with % but the line was longer
than 255 characters, an error occurred.  (pdf_main.ps)
	- Masked images didn't set the color before drawing.  (gs_pdf.ps)
	- Extraneous blank lines in the trailer or cross-reference region
caused an error.  (pdf_base.ps, pdf_main.ps)

</pre><h3><a name="V3.63_Streams"></a>Streams</h3><pre>

Speeds up image interpolation a little.  Much more could be still be done.
(siscale.c)

</pre><h3><a name="V3.63_Library"></a>Library</h3><pre>

Fixes bugs:
	- An error in handling a boundary condition could cause a horizontal
streak of pixels to be turned on or off when it shouldn't be.  (gxfill.c)
	- The new scan-line-based filling loop could write pixels twice.
(The old trapezoid-based loop still does write pixels twice.)  (gxfill.c)
	- For multi-plane images, gs_image_next only sets *pused for the
last plane; this wasn't documented.  (gsimage.h)
	- Images with MultipleDataSources=true and two or more DataSources
referencing the same stream could get confused.  (gsimage.h, gsimage0.c)
	- 12-bit gray images caused an invalid memory access.  (gsimage.c)
	- Nearly-zero-thickness lines didn't get filled, because the hack
that compensates for this peculiarity of the MS Windows PostScript driver
accidentally got disabled.  (gxfill.c)
	- Some casts to remove 'const' were omitted.  (gxclread.c)
	- 1-line-high bitmaps could get written in the band list with an
inconsistent number of bytes, causing errors when reading.  (gxcldev.h,
gxclbits.c, gxclist.c, gxclpath.c, gxclread.c)
	- Isolated dots produced by round caps usually disappeared.  (They
still disappear sometimes.)  (gxstroke.c)
	- On 16-bit platforms, the computation of t2 and t3 in
gx_curve_x_at_y could overflow, leading to incorrect output.  (gxpcopy.c)
	- Stroking horizontal or vertical lines could produce variations of
1 pixel in the line width.  (gxstroke.c)
	- The default clipping region for band rendering was too large,
leading to wasted work.  (gxclread.c)
	- Guarantees no double pixel writing when necessary, i.e., when a
non-idempotent RasterOp is selected.  (gsropt.h, gxfill.c)
	- For unrotated black-and-white images, one column of pixels at the
right edge of the image might be incorrect.  (gsimage1.c)
	- A const pointer was passed inappropriately.  (gxistate.h,
gscoord.c)
	- CIE color conversion could address 1 element beyond the end of an
array, with unpredictable results.  (gscie.c)

Separates out the higher-level band list facilities, so they can be an
optional feature.  (lib.mak, gxcldev.h, gxclpath.h, gxclbits.c, gxclist.c,
gxclpath.c, gxclread.c)

Implements bitmap (fill_mask) clipping in the band list.  (gxcldev.h,
gxclpath.h, gxclist.c, gxclpath.c, gxclread.c)

Starts to separate out the RasterOp facility as an optional feature.
(lib.mak, gxdevice.h, gxdevrop.h, gdevdflt.c, gdevmrop.c)

Encapsulates the filling of free memory blocks in a macro, at the request of
a licensee.  (gdebug.h, gsmdebug.h, gsmemory.h, gs.c, gsalloc.c, gsmemory.c,
gxbcache.c)

Speeds up fill_rectangle for 32-bit devices.  (gdevm32.c)

Speeds up path writing in band lists a little.  (gxclpath.c)

Implements AccurateScreens along the lines described in the Adobe
documentation.  The current implementation can produce very large
super-cells, so it will not always be able to actually increase the screen
accuracy.  (gxdht.h, gsht.c, gshtscr.c)

</pre>

<h2><a name="Version3.62"></a>Version 3.62 (limited, incremental) (12/26/95)</h2>

<p>
This release makes some licensee-requested improvements in the garbage
collector and fixes a couple of minor bugs.  It also constitutes a
checkpoint for the forthcoming forked 3.53 release.

<h3><a name="V3.62_Documentation"></a>Documentation</h3><pre>
Notes that for Win32s, gs16spl.exe must be in the same directory as
gswin32.exe.  (install.doc)

Changes `3.N' to a real version number in the man page.  (gs.1)

Adds a reference to dos-psv, another "dumb terminal" user interface for
Ghostscript intended for MS-DOS users.  (README)

</pre><h3><a name="V3.62_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The stack size for some of the PC platforms was set too small.
(watc.mak, watcwin.mak)

Changes the default value of ORIENT1 from false to true, i.e., assumes that
a value of 1 for the orientation parameter of setpageparams indicates
portrait orientation.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.  It only
affects files created for roll-media imagesetters.  (gs_init.ps, use.doc)

</pre><h3><a name="V3.62_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The definition of the op_index_op_array_table macro had an
incorrect trailing semicolon.  (opdef.h)
	- Setting the PageSize policy to 1 and then trying to set the page
size caused an error if FIXEDMEDIA was selected.  (gs_setpd.ps)

Changes the garbage collector marking phase so that instead of just using a
single block (allocated, free, or default) for the mark stack, it can chain
all three types of block together.  (igc.h, igc.c, igcstr.c, ilocate.c)

Refactors the garbage collector slightly to reduce inter-module
dependencies.  (int.mak, igc.h, igcstr.h, igcstr.c)

Changes the garbage collector to keep track of ranges within each chunk that
must be scanned if the mark stack overflows.  (gxalloc.h, igc.c)

Adds [write]===[only] procedures, which act like == but also print the
contents of dictionaries, and ppstack, which acts like pstack but uses ===.
Changes ESTACKPRINT and OSTACKPRINT to use === rather than ==.  (gs_init.ps,
gs_setpd.ps)

</pre><h3><a name="V3.62_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- If a PDF file substituted a calibrated color space for the
DeviceGray or DeviceRGB color space using a ColorSpace resource, the
PostScript file that pdf2ps produced from that PDF file caused an error.
(gs_pdf.ps)

</pre><h3><a name="V3.62_Library"></a>Library</h3><pre>

Fixes bugs:
	- The debugging code for checking the sorting of line lists didn't
check for an empty list.  (gxfill.c)

</pre>

<h2><a name="Version3.61"></a>Version 3.61 (limited) (12/10/95)</h2>

<p>
This limited release fixes a few bugs (including a couple that significantly
affected character quality) and also includes some substantial performance
improvements.

<h3><a name="V3.61_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The directory name for the PNG library was incorrect.
(libpng.mak)
	- The analysis of curve monotonocity in gxpcopy.c had an error.
(gxpcopy.c)

Changes the subdirectory names for zlib and libpng to be consistent.
(make.doc)

Documents a possible problem with object file format incompatibilities in
certain versions of Linux.  (make.doc)

Documents the new distinction between devices and device prototypes.
(language.doc)

Adds a pointer to DEC's free pstotext utility.  (README)

</pre><h3><a name="V3.61_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- zlib.mak omitted some files in the encoding module dependencies.
(zlib.mak)
	- os2.mak referred to png.mak rather than libpng.mak.  (os2.mak)
	- The png devices didn't include gdevpccm.$(OBJ) as a required file.
(devs.mak)
	- Some modules in lib.mak referred to stream.h, which was defined in
int.mak.  (int.mak, lib.mak)
	- Quite a few dependencies on header files were missing from the
makefiles.  (int.mak, lib.mak, *.mak)

Adds a 'pg' target to the Unix makefiles, for building profiling
configurations.  (unix-end.mak)

</pre><h3><a name="V3.61_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- Type 1 fonts in which some characters are defined by PostScript
procedures couldn't be compiled.  (ccfont.h, iccfont.c, font2c.ps)
	- pdf2ps didn't write Widths or Encoding in the converted file,
producing incorrect spacing and incorrect characters.  (pdf_2ps.ps)
	- markhint.ps didn't handle the Type 1 'div' operator, causing
typecheck errors.  (markhint.ps)
	- markhint.ps ignored the hstem3 and vstem3 hints.  (markhint.ps)

Changes the rollconv.ps utility to produce files whose names conform to the
8.3 length restriction, and to reduce the fixed RAM overhead for Kanji
fonts.  (rollconv.ps)

Adds a utility for detecting compiler problems that affect Ghostscript.
(bughunt.sh)

</pre><h3><a name="V3.61_Drivers"></a>Drivers</h3><pre>

Adds anti-aliasing capability (-dTextAlphaBits and -dGraphicsAlphaBits) to
the PGM and PPM drivers.  (gdevpbm.c)

Declares the static_procs member of the device structure as const *.  This
should have been done a long time ago!  (drivers.doc, gxdevice.h)

</pre><h3><a name="V3.61_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- Printing didn't work in 32-bit MS Windows environments.
(bcwin32.mak, gdevmswn.c, gp_mswin.c)
	- There were some compatibility problems with IBM C.  (os2.mak,
gsdll.h, gdevpm.c, gp_os2.c)

Adds the PNG drivers to the 32-bit MS Windows and OS/2 makefiles.
(bcwin32.mak, os2.mak)

Adds a conditional to work around a bug in gcc 2.7.x (it didn't recognize
that the target of a const T * might still be mutable through aliasing).
(stdpre.h)

</pre><h3><a name="V3.61_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Rasterizing a character in a Type 1 font with an invalid FontBBox
left some garbage on the operand stack (bug introduced in 3.52 or 3.60).
(gs_type1.ps)
	- The font substitution algorithm could fail or loop.  (gs_fonts.ps)

Adds a little more support for CID fonts and CMaps.  (gs_cidfn.ps,
gs_cmap.ps)

</pre><h3><a name="V3.61_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- An #include &lt;memory_.h&gt; was missing.  (ziodev.h)
	- Scanner-detected errors (primarily syntaxerror) didn't report the
file position.  (gs_init.ps)
	- Rotated characters were rendered incorrectly (bug introduced in
3.52).  (gstype1.c)
	- Some compilers got upset about the use of 'dict' as a variable
name.  (zdict.c)
	- Operand stack overflows sometimes didn't set the "requested" field
correctly.  (interp.c)
	- Using -dBufferSpace= with a non-printer device caused an error.
(gs_init.ps)

Adds zlibEncode/Decode filters.  (int.mak, zfzlib.c)

Separates devices from device prototypes.  Prototypes, which lack the
writable attribute, cannot be installed as the current device or have their
parameters changed.  This change allows Ghostscript to be exited and
restarted without being reloaded, which solves some problems with DLL
usage.  ****** WE HAD TO SUBVERT THIS CHANGE BECAUSE OF MEMORY MANAGER
PROBLEMS, by making zgetdevice return a writable reference to the
prototype.  (We finally fixed this in release 3.65.)  (gs_init.ps, iref.h,
opcheck.h, zdevice.c, ztype.c, zwppm.c)

Extends the client API to allow for pushing values onto the operand stack.
(imain.h, gs.c, gsmain.c)

Defines a .setdefaultscreen procedure that sets the default halftone screen,
transfer function, and stroke adjustment for the current device.  Changes
selectdevice and setpagedevice so that they call .setdefaultscreen;
setpagedevice calls .setdefaultscreen before calling the Install procedure,
so that Install can set different parameters if it wishes.  Note that
setdevice does not do this.  (gs_init.ps, gs_setpd.ps)

</pre><h3><a name="V3.61_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Tf set the current text font twice, and interacted with pdf2ps in
an awkward way.  (gs_pdf.ps, pdf_2ps.ps, pdf_font.ps)
	- If a font had variant Widths, it could get confused in the cache
with the underlying font.  (pdf_font.ps)
	- If a character appeared twice in an encoding and the font
specified different Widths values for the two occurrences, the last Width
would be used.  We patched this to ignore zero Widths, which is not the
correct solution but which almost always produces correct output.
(pdf_font.ps)
	- Arrays containing nulls didn't print out correctly (bug introduced
in 3.60).  (gs_init.ps)
	- Some PDF files contain very large dictionaries, which caused a
stackoverflow.  (pdf_base.ps)

Speeds up the initial processing of PDF files by caching the map from page
numbers to page objects, and by not scanning the outlines if we aren't
producing PostScript output.  (pdf_2ps.ps, pdf_base.ps, pdf_main.ps)

</pre><h3><a name="V3.61_Streams"></a>Streams</h3><pre>

Adds zlibEncode/Decode filters.  (lib.mak, szlibx.h, szlibc.c, szlibd.c,
szlibe.c)

</pre><h3><a name="V3.61_Library"></a>Library</h3><pre>

Fixes bugs:
	- glyphshow displayed a character with code 0 rather than the
requested character (bug introduced in 3.60.)  (gschar.c)
	- If trimming white space around a character reduced its raster, the
character was garbled in the cache (bug introduced in 3.60.)  (gxccman.c)
	- colorimage would incorrectly convert white pixels to black if the
image color space was CMYK, the current color space was not CMYK, and the
number of bits per pixel was 4 or 8.  (gsimage2.c)
	- One of the clipping tests for images was backwards (bug introduced
in 3.60).  (gsimage.c)
	- Type 1 fonts that used the Flex feature applied hints to the path
multiple times, causing dropouts, uneven stems, and other problems (bug
probably introduced in 3.21).  (gstype1.c)
	- If a Type 1 font used the Flex feature within the accent of an
accented character defined with seac, the shape of the accent could be
distorted.  (gxtype1.h, gstype1.c)
	- If a Type 1 font changed hints using the hint replacement facility
when the last operation was a closepath, the old hints would be applied a
second time, distorting the shape.  (gxhint3.c)
	- Band lists could read garbage beyond the end of data for a band,
causing unpredictable errors (bug introduced in 3.60).  (gxclread.c)
	- If the bounding box of the path for fill_path or stroke_path went
outside the device page boundary when banding, out-of-bounds memory
references occurred (bug introduced in 3.60).  (gxdevice.h, gxclpath.c)

Adds an alternative implementation of the core path filling algorithm that
is much faster on objects with curves but doesn't handle Y fattening.  This
is the implementation that will normally be used for rasterizing characters.
This implementation rasterizes curves directly, without flattening them.
(gxfixed.h, gxpath.h, gzpath.h, gsdps1.c, gxfill.c, gxpcopy.c, gxpdash.c)

Speeds up the flattening of curves substantially by omitting more redundant
points.  (gxpcopy.c)

Speeds up character bitmap compression a little more.  (gsbitops.h,
gdevabuf.c, gsbitops.c, gxccman.c)

Speeds up anti-aliased graphics a bit by computing a bounding box before
converting from oversampling to alpha values, and by speeding up the
bounding box computation itself.  (gsbitops.h, gdevabuf.c, gsbitops.c,
gxccman.c)

</pre>

<h2><a name="Version3.60"></a>Version 3.60 (limited) (11/20/95)</h2>

<p>
(Note: release numbers 3.54 through 3.59 were deliberately skipped.)  This
internal release includes a major redesign of band lists in order to reduce
their size for embedded implementations, to move towards supporting "vector"
output formats, and to further separate the imager library from the language
interpreters.

<h3><a name="V3.60_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- A comment was incorrect.  (viewpbm.ps)
	- The PixelDifference filters were not documented.  (language.doc)
	- The change from currenttime to .currenttime wasn't documented.
(language.doc)
	- gs.1 incorrectly stated that the default font directory name
included the version number.  (gs.1)
	- The -g and -r switches didn't specify that the units for their
arguments are pixels and pixels per inch respectively.  (use.doc)
	- The PageOffset page device parameter wasn't listed.
(language.doc)

Changes copy_mono and copy_color to optional procedures.  (drivers.doc)

Adds a reference to ps_view.ps, a "dumb terminal" user interface for
Ghostscript intended for MS-DOS users.  (README)

Splits off the documentation on installing Ghostscript into a separate file.
(readme, install.doc, use.doc)

Adds documentation on the data format produced by the standard LZWEncode
filter.  (readme, lzwce.doc)

Clarifies XLIBDIR vs. XLIBDIRS.  (make.doc)

Adds user-contributed documentation on building Ghostscript under QNX.
(make.doc)

</pre><h3><a name="V3.60_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The rule for building dfaxhigh.dev had a typo.  (devs.mak)
	- The dependencies for gdevpipe.h were missing errno__h and
string__h.  (unixtail.mak)
	- The geninit program (the implementation of COMPILE_INITS=1) didn't
parse the command line properly, and didn't check for PostScript files
properly.  (geninit.c)
	- ccfontab.c was omitted from the fileset.  The easiest way to fix
this was to rename it to icfontab.c.  (gs.mak, int.mak, ccfontab.c)
	- The Unix makefiles installed caption.ls (a typo) rather than
caption.ps.  (unix-end.mak)
	- XLIBDIR, for dynamic library access, wasn't defined.  (*head.mak,
*tail.mak, ugcclib.mak)

Adds the PNG and ZLIB makefiles to the fileset.  (*.mak, png.mak, zlib.mak,
tar_cat)

Puts the PixelDifference filters in the standard Level 2 set, since the LZW
filters may invoke them (a post-Red Book addition to the PostScript language
definition).  (int.mak)

Adds -Wcast-qual to the gcc compiler flags.  (gcc-head.mak)

Adds the PNG drivers to the standard Unix configurations.
(ansi/cc-/gcc-head.mak)

Adds a -dNOFONTPATH switch to suppress any consultation of the FONTPATH
variable or the GS_FONTPATH environment variable.  (gs_fonts.ps, gs_init.ps)

</pre><h3><a name="V3.60_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- The default scaling for viewing PBM files was computed
incorrectly.  (viewpbm.ps)
	- ps2ascii left a value on the stack for each unrecognized character
it processed, eventually causing a stackoverflow.  (ps2ascii.ps)

Changes viewpbm.ps so that it simply defines P1 through P6, allowing PBM
files to be executed with 'run'.  (viewpbm.ps)

Adds a small benchmark to crudely measure hardware/system performance.  The
same file can either be compiled as a C program or executed as a PostScript
program.  (bench.c)

Adds a few PPD files to the distribution.  There will probably be more as
time goes on.  (tar_gs, unix-end.mak)

Updates the Unix lpr scripts to handle a wider variety of device options.
(unix-lpr.doc, lprsetup.sh, unix-lpr.sh)

Adds a utility for converting files produced by Macromedia's Rollup program
to a Type 0 form directly usable by Ghostscript.  (rollconv.ps)

</pre><h3><a name="V3.60_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Forwarding devices passed an incorrect first argument when
forwarding a copy_rop operation.  (gsdevice.c)
	- Because of a typo, the LaserJet drivers had incorrect margins.
This was probably a new bug in 3.5x.  (gdevdjet.c)
	- A private name was duplicated.  (gdevtfax.c)
	- The x11alpha driver passed invalid colors to the X library.
(gdevxalt.c)
	- The x11alpha driver set the blue component of colors incorrectly.
(gdevxalt.c)
	- Some `const' declarations were missing.  (gdevtifs.c, gdevtfnx.c,
gdevxxf.c)
	- The size of A4 paper was slightly inconsistent across drivers.
(gdevdjet.c, gdevl256.c)

Provides default implementations of copy_mono and copy_color in terms of
fill_rectangle.  (gxdevice.h, gsdevice.c)

Adds forwarders for sync_output and output_page.  (gxdevice.h, gsdevice.c)

Adds new optional procedures to the driver interface:
	- fill_path for filling a path with a color;
	- stroke_path for stroking a path;
	- fill_mask for painting a color through a mask.
The default implementations use the existing rasterizer algorithms.  This
involves a NON-BACKWARD-COMPATIBLE change to the parameters of a few
internal routines:
	gs_currentlineparams
	gx_fill_path, gx_fill_path_only, gx_path_expand_dashes, gx_path_flatten
and two externally visible routines not part of standard PostScript:
	gs_setfilladjust, gs_currentfilladjust
(gdevmem.h, gdevprn.h, gspath.h, gspenum.h, gxcpath.h, gxdevice.h, gxdraw.h,
gxpaint.h, gxpath.h, gscoord.c, gsdevice.c, gspaint.c, gsstate.c,
gxacpath.c, gxclist.c, gxclread.c, gxcpath.c, gxdraw.c, gxfill.c, gxpaint.c,
gxpcmap.c, gxpcopy.c, gxstroke.c)

Makes major changes to the dithering algorithm for the color DeskJet and
BubbleJet drivers, contributed by a user.  (gdevcdj.c)

Adds a contributed 12-bit RGB TIFF driver.  (gdevtfnx.c)

</pre><h3><a name="V3.60_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The printjob created by Ghostscript was called "Ghostscirpt"
instead of "Ghostscript".  (gp_os2.c)
	- An "export" declaration was omitted from DllInit.  (gp_mswin.c)

Removes gp_get_clock (its interface was changed from calendar
days/milliseconds to epoch seconds/nanoseconds in an undocumented,
NON-BACKWARD-COMPATIBLE change in 3.51), and adds a new gp_get_realtime
procedure that returns epoch seconds/nanoseconds.  This too is a
NON-BACKWARD-COMPATIBLE change; it is required because we overlooked the
prior change in a batch of user-contributed code.  (gp.h, gp_*.c)

</pre><h3><a name="V3.60_Fonts"></a>Fonts</h3><pre>

Adds Heavy as a synonym for Bold when doing intelligent font substitution.
(gs_fonts.ps)

</pre><h3><a name="V3.60_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The setup for the CCITTFax filters set the 'raster' element
redundantly.  (zfdecode.c)
	- currentscreen and currentcolorscreen could give an error if the
current screen was set with sethalftone (or, for currentscreen,
setcolorscreen).  (gs_dps1.ps)
	- The font operators didn't work properly if a PostScript file
redefined certain operator names.  (gs_res.ps)
	- The CCITTFax filters imposed a limit of 9999 Rows or Columns.  The
new limit is 32000.  (zfdecode.c)
	- Streams could get removed from a bookkeeping list prematurely, and
wind up dangling.  (zfile.c)
	- The garbage collector didn't ask for large enough a mark stack,
and only used half of what it got.  (This was only a performance problem.)
(igc.c)
	- Two private names duplicated names in a vendor library.  (zbseq.c)
	- Type 1 fonts didn't enforce the maximum value of BlueScale, which
caused some faulty fonts produced by Fontographer to produce incorrect
output.  (zfont1.c)
	- cvs / cvrs / = didn't produce Adobe-compatible output.
(gs_init.ps, iutil.h, iutil.c, zfileio.c)
	- Multiple -I switches set the search path incorrectly.  (gsmain.c)
	- Many `const' declarations were missing.  (icie.h, idparam.h,
iref.h, iutil.h, idparam.c, iinit.c, ilocate.c, iname.c, interp.c, iparam.c,
iutil.c, zcie.c, zfile.c, zgstate.c, ziodev.c, ztype.c)
	- Fonts could wind up with a pointer to the wrong VM space, causing
potential GC or save/restore confusion.  (zfont2.c)
	- upath could leave garbage on the stack if it failed.  (gs_dps1.ps)

Speeds up rasterizing characters into the cache a little.  (gs_type0.ps)

Changes the default limit on the size of cached characters from the maximum
of (18 points or 5 times the "average" character size) to (18 points or 1%
of the total cache size).  (gs_init.ps)

Adds the DecodedByteAlign parameter to the CCITTFax filters.  (zfdecode.c)

Updates some code for compatibility with the new fill_path driver procedure.
(zupath.c)

Replaces .set/currentfilladjust with .set/currentfilladjust2, and defines
the former in terms of the latter.  (gs_init.ps, zgstate.c)

Extends the make[word]imagedevice operators to accept palette values of 16,
24, and 32, for creating true-color image devices.  (zdevice.c)

Changes realtime to match the definition of gp_get_realtime.  (zmisc.c)

Removes the [.]currenttime operator.  realtime provides interval timing in
milliseconds; the %Calendar% IODevice provides calendar times.  (zmisc.c)

Extends the LZW filters to handle the PDF Predictor (pixel-differencing)
option.  (zfdecode.c, zfilter2.c, zfpdiff.c (deleted))

</pre><h3><a name="V3.60_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- The length of an image's data was sometimes calculated
incorrectly, causing an error when converting PDF to PostScript.
(pdf_draw.ps)
	- If word spacing and/or text spacing was non-zero, an error could
occur.  (gs_pdf.ps)
	- Text that was both filled and stroked caused an error.
(gs_pdf.ps)

</pre><h3><a name="V3.60_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- When closing an encoding filter stream whose target was also a
filter, the latter could get called incorrectly with last = 1, possibly more
than once, leading to premature EOD markers.  (stream.c)
	- The LZW-compatible encoder put out an incorrect end-of-data code.
(slzwce.c)
	- The LZW-compatible encoder didn't put out a reset code soon
enough.  (slzwce.c)
	- Some `const' declarations were missing.  (siscale.c)
	- Doing a sgets on a closed stream could call sreadbuf, possibly
causing an error.  (stream.c)

Adds a new (optional) set_defaults procedure to the stream template, which
sets the stream parameters to default values.  We only implement it for a
few stream types.  (scfx.h, scommon.h, slzwx.h, spdiffx.h, srlx.h,
strimpl.h, scfd.c, scfe.c, slzwce.c, slzwd.c, slzwe.c, spdiff.c, srld.c,
srle.c)

Adds a new parameter to the CCITTFax filters, DecodedByteAlign.  This is an
integer N, which must be a power of 2 between 1 (2^0) and 16 (2^4), that
specifies that decoded data scan lines are always a multiple of N bytes.
The encoding filter skips data in each scan line from Columns to the next
multiple of N bytes; the decoding filter pads each scan line to a multiple
of N bytes.  Default value: 1.  (scfx.h, scfd.c, scfe.c)

Increases the maximum width of a scan line for the CCITTFaxEncode filter to
32000 pixels.  (scf.h)

</pre><h3><a name="V3.60_Library"></a>Library</h3><pre>

Fixes bugs:
	- Cached characters sometimes had extra blank space on the left,
leading to some unnecessary bit-shuffling when imaging them.  (gxccman.c)
	- In rare cases, gray halftones called gx_color_load unnecessarily.
(gxdither.c)
	- The list of all-bands commands wasn't initialized/reset properly.
(gxclist.c, gxclread.c)
	- Rendering an anti-aliased character to a non-anti-aliased device
didn't free the temporary bitmap, causing memory to be lost.  (gxccache.c)
	- Dash patterns where the offset exactly reached a run of length 0
skipped over the 0-length run.  (gsline.c)
	- Rectangles closed with both lineto and closepath weren't
recognized as rectangles.  This is only a performance bug.  (gxpath2.c)
	- Because of a typo in a macro formal parameter list, a private name
was duplicated.  (gsstruct.h)
	- Text display operations didn't update the current character in the
enumerator structure during the fastest path through the code.  This only
matters to one very unusual commercial client.  (gschar.c)
	- Some `const' declarations were missing.  (gsparam.h, gxistate.h,
stdpre.h; gdevm1.c, gsalloc.c, gsfont.c, gsimage3.c, gsmemory.c, gsmisc.c,
gspcolor.c, gstype1.c, gxfill.c, gxpcopy.c)

Changes the header files to assume that gcc on Solaris defines
__svr4__ and that, in this case, &lt;string.h&gt; has the right stuff in it.
(memory_.h)

Refactors the character cache to share structures with a similar cache
used by band lists.  Eventually the band list may be able to reference
the character cache directly, saving a lot of copying.  (gxbcache.h,
gxfcache.h, gsfont.c, gxbcache.c, gxccache.c, gxccman.c)

Speeds up getting the side bearing and width of a Type 1 charstring a
little.  (gxtype1.h, gstype1.c)

Redesigns band lists so that they can cache character bitmaps as well as
halftone bitmaps.  Characters may be written for all bands, not just the
band(s) they appear in, depending on the setting of the CHAR_ALL_BANDS_COUNT
parameter in gxclbits.c.  (gxcldev.h, gxclist.h, gxclbits.c, gxclist.c,
gxclread.c)

Adds G4 fax compression for band list bitmaps.  (gxcldev.h, gxclist.c,
gxclread.c)

Incorporates the new set_defaults procedure into the memory-based band list
implementation.  (gxclmem.c)

Implements a halftoning device that can be used in a device pipeline.
(gdevht.h, gzht.h, gdevht.c, gxcht.c)

Factors out imager state from the full graphics state.  This division is
preliminary and subject to change.  (gxistate.h, gxop1.h, gzstate.h,
gsline.c, gsstate.c, gstype1.c, gxhint*.c)

Implements passing fill operations in the band list, except for pattern
color or colored halftones.  (gxcldev.h, gxclist.h, gxclist.c, gxclread.c)

Implements passing stroke operations in the band list, except for pattern
color or colored halftones.  (gsline.h, gslparam.h, gxline.h, gzline.h,
gsline.c; gxcldev.h, gxclist.h, gxclist.c, gxclread.c)

Implements the ability to represent halftoned characters in the band list.
(gxccache.c)

Starts to implement the ability to do halftoning during the rendering phase
rather than before writing the band list (currently for black-and-white
devices only).  Doing this required NON-BACKWARD-COMPATIBLE changes to the
interfaces of a few internal procedures:
	gx_check_tile_size, gx_render_device_{color,gray}
(gxdcolor.h, gxdht.h, gzht.h, gsht.c, gsimage1.c, gsmisc.c, gspcolor.c,
gsstate.c, gxcht.c, gxclbits.c, gxdither.c, gxht.c)

Implements passing clipping information in the band list.  (gzcpath.h,
gxacpath.c, gxclpath.c, gxclread.c, gxcpath.c)

Removes the gs_state * parameter from the device color fill_rectangle
procedures and many of their callers, since it is no longer needed.  This is
a non-backward-compatible change to an internal API.  (gdevmrop.h,
gxdcolor.h, gxdraw.h, gxpaint.h, gdevmrop.c, gsimage.c, gspcolor.c, gxcht.c,
gxclread.c, gxdraw.c, gxfill.c, gxht.c, gxpaint.c, gxstroke.c)

Removes gxdevice.h from gzstate.h, since not all modules requiring access to
the graphics state need to know the implementation of devices.  This entails
adding gxdevice.h to the include lists for some modules.  (gxchar.h,
gxcpath.h, gxcvalue.h, gxdevice.h, gxtype1.h, gzstate.h; gschar.c,
gscoord.c, gsdevice.c, gsimage1.c, gsimage2.c, gsimage3.c, gspaint.c,
gspath.c, gsstate.c, gstype1.c, gxccache.c, gxccman.c, gxhint1.c, gxhint2.c,
gxhint3.c, gxpaint.c)

Adds a compile-time option, ALPHA_LSB_FIRST, which causes alpha-sampled
characters to be nibble-reversed in the cache.  This was created for a
specialized application and does not interact well with the rest of the
code.  (gsbitops.c)

Substantially reduces the space required to represent 24- or 32-bit colors
in the band list, by using more aggressive color differencing.  (gxcldev.h,
gxclist.c, gxclread.c)

Changes the allocation of unique IDs for halftone tiles to use the gray
level rather than the number of 1-bits as the increment to a base ID; this
allows more efficient (delta) representation of halftone indices in the band
list.  (gxcldev.h, gxclist.c, gxclread.c, gxht.c)

Substantially speeds up entering anti-aliased characters in the cache, by
removing white space before compressing rather than vice versa.
(gsbitops.c, gxccman.c)

</pre>

<hr>

<h2><a name="Version3.53"></a>Version 3.53 (1/10/96)</h2>

<p>
This is an anomalous, out-of-sequence release requested by a commercial
licensee.  It consists of 3.52 plus the following retrofits from 3.60
through 3.63:
	- PDF interpreter and pdf2ps;
	- Type 1 rasterizer fixes;
	- Type 1 rasterizer and polygon fill performance improvements;
	- MS Windows and OS/2 fixes;
	- A few other important fixes.
It does NOT fix all problems reported since 3.52.

<p>
The list of changes below indicates which subsequent release was the source
of each change.  In several cases, minor editing of the change was required
to make it compatible with 3.52.

<h3><a name="V3.53_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	[3.61] The analysis of curve monotonocity in gxpcopy.c had an error.
(gxpcopy.c)

[3.63] Notes that the OS/2 implementation now requires EMX/GCC 0.9b rather
than 0.9a.  (use.doc)

[3.62] Notes that for Win32s, gs16spl.exe must be in the same directory as
gswin32.exe.  (use.doc)

[3.62] Adds a reference to dos-psv, another "dumb terminal" user interface
for Ghostscript intended for MS-DOS users.  (README)

[3.61] Adds a pointer to DEC's free pstotext utility.  (README)

[3.60] Adds a reference to ps_view.ps, a "dumb terminal" user interface for
Ghostscript intended for MS-DOS users.  (README)

</pre><h3><a name="V3.53_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	[3.60] The geninit program (the implementation of COMPILE_INITS=1)
didn't parse the command line properly, and didn't check for PostScript
files properly.  (geninit.c)
	[3.60] ccfontab.c was omitted from the fileset.  The easiest way to
fix this was to rename it to icfontab.c.  (gs.mak, int.mak, ccfontab.c)
	[3.60] The definition of pdfread.dev did an ADDMOD, not a SETMOD.
(int.mak)

[3.60] Adds a -dNOFONTPATH switch to suppress any consultation of the
FONTPATH variable or the GS_FONTPATH environment variable.  (gs_fonts.ps,
gs_init.ps)

</pre><h3><a name="V3.53_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	[3.61] pdf2ps didn't write Widths or Encoding in the converted file,
producing incorrect spacing and incorrect characters.  (pdf_2ps.ps)
	[3.60] ps2ascii left a value on the stack for each unrecognized
character it processed, eventually causing a stackoverflow.  (ps2ascii.ps)

[3.61] Changes the rollconv.ps utility to produce files whose names conform
to the 8.3 length restriction, and to reduce the fixed RAM overhead for
Kanji fonts.  (rollconv.ps)

[3.60] Adds a utility for converting files produced by Macromedia's Rollup
program to a Type 0 form directly usable by Ghostscript.  (rollconv.ps)

</pre><h3><a name="V3.53_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	[3.60] Because of a typo, the LaserJet drivers had incorrect
margins.  This was probably a new bug in 3.5x.  (gdevdjet.c)
	[3.60] A private name was duplicated.  (gdevtfax.c)
	[3.60] The x11alpha driver passed invalid colors to the X library.
(gdevxalt.c)
	[3.60] The x11alpha driver set the blue component of colors
incorrectly.  (gdevxalt.c)

</pre><h3><a name="V3.53_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	[3.63] The test for WinExec failure on Win32 was incorrect.
(gp_mswin.c)
	[3.63] getenv was declared redundantly on OS/2.  (gp_os2.c)
	[3.63] gs16spl.c was missing &lt;string.h&gt;.  (gs16spl.c)
	[3.61] Printing didn't work in 32-bit MS Windows environments.
(bcwin32.mak, gdevmswn.c, gp_mswin.c)
	[3.61] There were some compatibility problems with IBM C.  (os2.mak,
gsdll.h, gdevpm.c, gp_os2.c)
	[3.60] The printjob created by Ghostscript was called "Ghostscirpt"
instead of "Ghostscript".  (gp_os2.c)
	[3.60] An "export" declaration was omitted from DllInit.
(gp_mswin.c)

[3.61] Adds a conditional to work around a bug in gcc 2.7.x (it didn't
recognize that the target of a const T * might still be mutable through
aliasing).  (stdpre.h)

</pre><h3><a name="V3.53_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	[3.61] Rasterizing a character in a Type 1 font with an invalid
FontBBox left some garbage on the operand stack (bug introduced in 3.52 or
3.60).  (gs_type1.ps)
	[3.61] The font substitution algorithm could fail or loop.
(gs_fonts.ps)

[3.60] Adds Heavy as a synonym for Bold when doing intelligent font
substitution.  (gs_fonts.ps)

</pre><h3><a name="V3.53_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	[3.63] Invoking setpagedevice with an undefined key, even with
Policy = 1, caused an error.  (gs_setpd.ps)
	[3.62] Setting the PageSize policy to 1 and then trying to set the
page size caused an error if FIXEDMEDIA was selected.  (gs_setpd.ps)
	[3.61] Rotated characters were rendered incorrectly (bug introduced
in 3.52).  (gstype1.c)
	[3.60] currentscreen and currentcolorscreen could give an error if
the current screen was set with sethalftone (or, for currentscreen,
setcolorscreen).  (gs_dps1.ps)
	[3.60] Streams could get removed from a bookkeeping list
prematurely, and wind up dangling.  (zfile.c)
	[3.60] Multiple -I switches set the search path incorrectly.
(gsmain.c)
	[3.60] Fonts could wind up with a pointer to the wrong VM space,
causing potential GC or save/restore confusion.  (zfont2.c)
	[3.60] upath could leave garbage on the stack if it failed.
(gs_dps1.ps)

[3.61] Extends the client API to allow for pushing values onto the operand
stack.  (imain.h, gs.c, gsmain.c)

[3.61] Defines a .setdefaultscreen procedure that sets the default halftone
screen, transfer function, and stroke adjustment for the current device.
Changes selectdevice and setpagedevice so that they call .setdefaultscreen;
setpagedevice calls .setdefaultscreen before calling the Install procedure,
so that Install can set different parameters if it wishes.  Note that
setdevice does not do this.  (gs_init.ps, gs_setpd.ps)

[3.60] Speeds up rasterizing characters into the cache a little.
(gs_type0.ps)

[3.60] Changes the default limit on the size of cached characters from the
maximum of (18 points or 5 times the "average" character size) to (18 points
or 1% of the total cache size).  (gs_init.ps)

[3.60] Implements parts of the Type 1 BuildChar callout in C.  (gs_type1.ps,
zchar.c)

</pre><h3><a name="V3.53_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	[3.62] If a PDF file substituted a calibrated color space for the
DeviceGray or DeviceRGB color space using a ColorSpace resource, the
PostScript file that pdf2ps produced from that PDF file caused an error.
(gs_pdf.ps)
	[3.61] Tf set the current text font twice, and interacted with
pdf2ps in an awkward way.  (gs_pdf.ps, pdf_2ps.ps, pdf_font.ps)
	[3.61] If a font had variant Widths, it could get confused in the
cache with the underlying font.  (pdf_font.ps)
	[3.61] If a character appeared twice in an encoding and the font
specified different Widths values for the two occurrences, the last Width
would be used.  We patched this to ignore zero Widths, which is not the
correct solution but which almost always produces correct output.
(pdf_font.ps)
	[3.61] Arrays containing nulls didn't print out correctly (bug
introduced in 3.60).  (gs_init.ps)
	[3.61] Some PDF files contain very large dictionaries, which caused
a stackoverflow.  (pdf_base.ps)
	[3.60] The length of an image's data was sometimes calculated
incorrectly, causing an error when converting PDF to PostScript.
(pdf_draw.ps)
	[3.60] If word spacing and/or text spacing was non-zero, an error
could occur.  (gs_pdf.ps)
	[3.60] Text that was both filled and stroked caused an error.
(gs_pdf.ps)

[3.61] Speeds up the initial processing of PDF files by caching the map from
page numbers to page objects, and by not scanning the outlines if we aren't
producing PostScript output.  (pdf_2ps.ps, pdf_base.ps, pdf_main.ps)

</pre><h3><a name="V3.53_Streams"></a>Streams</h3><pre>

Fixes bugs:
	[3.60] When closing an encoding filter stream whose target was also
a filter, the latter could get called incorrectly with last = 1, possibly
more than once, leading to premature EOD markers.  (stream.c)
	[3.60] The LZW-compatible encoder put out an incorrect end-of-data
code.  (slzwce.c)
	[3.60] The LZW-compatible encoder didn't put out a reset code soon
enough.  (slzwce.c)
	[3.60] Doing a sgets on a closed stream could call sreadbuf,
possibly causing an error.  (stream.c)

</pre><h3><a name="V3.53_Library"></a>Library</h3><pre>

Fixes bugs:
	[3.63] On 16-bit platforms, the computation of t2 and t3 in
gx_curve_x_at_y could overflow, leading to incorrect output.  (gxpcopy.c)
	[3.61] glyphshow displayed a character with code 0 rather than the
requested character (bug introduced in 3.60.)  (gschar.c)
	[3.61] If trimming white space around a character reduced its
raster, the character was garbled in the cache (bug introduced in 3.60.)
(gxccman.c)
	[3.61] colorimage would incorrectly convert white pixels to black if
the image color space was CMYK, the current color space was not CMYK, and
the number of bits per pixel was 4 or 8.  (gsimage2.c)
	[3.61] Type 1 fonts that used the Flex feature applied hints to the
path multiple times, causing dropouts, uneven stems, and other problems (bug
probably introduced in 3.21).  (gstype1.c)
	[3.61] If a Type 1 font used the Flex feature within the accent of
an accented character defined with seac, the shape of the accent could be
distorted.  (gxtype1.h, gstype1.c)
	[3.61] If a Type 1 font changed hints using the hint replacement
facility when the last operation was a closepath, the old hints would be
applied a second time, distorting the shape.  (gxhint2.c, gxhint3.c)
	[3.60] Cached characters sometimes had extra blank space on the
left, leading to some unnecessary bit-shuffling when imaging them.
(gxccman.c)
	[3.60] The list of all-bands commands wasn't initialized/reset
properly.  (gxclist.c)
	[3.60] Because of a typo in a macro formal parameter list, a private
name was duplicated.  (gsstruct.h)
	[3.60] Text display operations didn't update the current character
in the enumerator structure during the fastest path through the code.  This
only matters to one very unusual commercial client.  (gschar.c)

[3.61] Adds an alternative implementation of the core path filling algorithm
that is much faster on objects with curves but doesn't handle Y fattening.
This is the implementation that will normally be used for rasterizing
characters.  This implementation rasterizes curves directly, without
flattening them.  (gxfixed.h, gxpath.h, gzpath.h, gxdraw.c, gxfill.c,
gxpcopy.c)

[3.61] Speeds up the flattening of curves substantially by omitting more
redundant points.  (gxpcopy.c)

[3.61] Speeds up character bitmap compression a little more.  (gsbitops.h,
gdevabuf.c, gsbitops.c, gxccman.c)

[3.61] Speeds up anti-aliased graphics a bit by computing a bounding box
before converting from oversampling to alpha values, and by speeding up the
bounding box computation itself.  (gsbitops.h, gdevabuf.c, gsbitops.c,
gxccman.c)

[3.60] Speeds up getting the side bearing and width of a Type 1 charstring a
little.  (gxtype1.h, gstype1.c)

[3.60] Adds a compile-time option, ALPHA_LSB_FIRST, which causes
alpha-sampled characters to be nibble-reversed in the cache.  This was
created for a specialized application and does not interact well with the
rest of the code.  (gsbitops.c)

[3.60] Substantially speeds up entering anti-aliased characters in the
cache, by removing white space before compressing rather than vice versa.
(gsbitops.c, gxccman.c)

</pre>

<h2><a name="Version3.52"></a>Version 3.52 (limited) (10/6/95)</h2>

<p>
This is an incremental release to fix a few problems in 3.51.  Since it is
being made in an environment with no network connectivity, it will probably
not be released to the general public.  ****** THE CHANGES MARKED WITH ***
BELOW WERE LOST IN THE PROCESS OF SHUFFLING FILESETS BETWEEN ENVIRONMENTS.
THEY ARE INCORPORATED IN 3.60 BUT NOT IN 3.52. ******

<h3><a name="V3.52_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The fileset included a meaningless empty file.  (acctest.ps)
	*** The definition of pdfread.dev did an ADDMOD, not a SETMOD.
(int.mak)

</pre><h3><a name="V3.52_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The RunLengthEncode filter used with a dictionary argument could
give a spurious error.  (zfilter.c)
	- The fast form of the 'dup' operator failed to check for stack
overflow, which could lead to memory smashing.  (interp.c)
	*** Level 1 configurations gave errors during initialization.
(ialloc.c, iinit.c, ireclaim.c)
	*** Attempting to look up or insert a noaccess string as a
dictionary key converted the string to a name rather than giving an error.
(idict.h, idict.c)

Adds a C implementation of the .dicttomark (&gt;&gt;) procedure.  (gs_init.ps,
zdict.c)

*** Implements parts of the Type 1 BuildChar callout in C.  (gs_type1.ps,
ifont.h, zchar.c, zfont1.c, zfont2.c)

</pre><h3><a name="V3.52_Library"></a>Library</h3><pre>

Fixes bugs:
	- Braces were missing in an initializer.  (gxdcolor.h)
	- Composite fonts with a non-zero translation in the FontMatrix
positioned characters incorrectly.  (gschar.c)
	*** gsparam.c wouldn't compile with some versions of the Borland
compiler.  (gsparam.c)

Speeds up the handling of curve segments in Type 1 fonts a little.
(gstype1.c)

Speeds up displaying very short strings a little.  (gschar.c)

*** Implements parts of the Type 1 BuildChar callout in C.  (gxfont.h)

</pre>

<h2><a name="Version3.51"></a>Version 3.51 (9/27/95)</h2>

<p>
This is the first public release since 3.33.  Its main features are a
working setpagedevice, a working PDF interpreter, and a working PDF to PS
converter.

<h3><a name="V3.51_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- The -dSHORTERRORS switch wasn't documented in enough places.
(current.doc, use.doc)
	- The DLL documentation was internally inconsistent.  (dll.doc)
	- The %pipe% file name syntax wasn't documented.  (language.doc)

</pre><h3><a name="V3.51_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- caption.ps wasn't installed properly.  (unix-end.mak)
	- geninit depended on $(gconfig_h) in an improper way.  (geninit.c,
int.mak, *.mak)
	- One script lacked the #!/bin/sh header.  (gsdj500)

Adds the 24-bit color TIFF driver to all configurations that support
black-and-white TIFF.  (*.mak)

</pre><h3><a name="V3.51_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- align.ps was omitted from the fileset.  (psfiles.doc, align.ps,
unix-end.mak)

</pre><h3><a name="V3.51_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- A driver had some \s in formal parameter lists.  (gdevcdj.c)
	- A driver had some improper &amp;s.  (gdevtifs.c)
	- The default MS Windows printer driver was very slow.  (gdevwpr2.c)
	- The (newly restructured) TIFF drivers could produce a memory
access error.  (gdevtifs.c)
	- The CGM drivers referred to an obsolete structure member.
(gdevcgm.c)
	- The black-and-white H-P drivers didn't set the margins properly
(again).  (gdevdjet.c)
	- Several of the most common printer drivers omitted some scan lines
at the bottom of the page.  (gdevprn.h, gdevprn.c)

At the request of the main OS/2 developer, adds a printer device for OS/2.
(gdevos2p.c, os2.mak)

Makes many changes to the stcolor driver, submitted by the developer just
before the release.  (devices.doc, unix-end.mak, gdevstc.h, gdevstc*.c,
stcinfo.ps, stcolor.ps, stcinfo.ps)

</pre><h3><a name="V3.51_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- usertime (and realtime) were broken on VMS.  (gp_vms.c)
	- The 32-bit MS Windows DLL control file had a typo.  (gsdll32.def)

Removes the color inkjet drivers from the 16-bit Windows executable, because
they overflow the 64K default data segment; adds PCX, TIFF, and BMP output
formats.  (bcwin.mak)

</pre><h3><a name="V3.51_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- A routine was declared 'private' inconsistently.  (zcie.c)
	- -dSHORTERRORS didn't remove enough non-Adobe error output.
(gs_init.ps)

</pre><h3><a name="V3.51_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- The ProcSet relied on the presence of NullFont.  (gs_pdf.ps)

</pre><h3><a name="V3.51_Library"></a>Library</h3><pre>

Fixes bugs:
	- There was an extraneous \ outside a macro.  (gsline.c)
	- Scaling up a black-and-white image could caused many scan lines to
be inverted.  (gsimage1.c)
	- The initial clipping path did not take Margins into account
properly.  (gxdevice.h, gdevxalt.c, gscoord.c, gsdevice.c, gsdevmem.c,
gsdparam.c, gspath.c)
	- If banding was required, characters could come out as solid black
rectangles.  (gxclist.c, gxclread.c)

</pre>

<h2><a name="Version3.50"></a>Version 3.50 (limited) (9/24/95)</h2>

<p>
This is the last limited bug-fix release during beta test.  The color
DeskJet drivers are broken (they sometimes produce black rectangles instead
of characters); we will fix this in the next release.
<p>
The following issues have been postponed to an unspecified future release:
<ul>
<li>	- Filling areas often writes pixels twice, causing incorrect
output
with certain unusual RasterOp values.  [1.814]
<li>	- The tar.gz archives should include a subdirectory like
gs-3.46/ in
the file names.
<li>	- The CCITTFaxDecode filter should skip initial junk if
EndOfLine =
true.  [1844 8/24/95, NRE]
</ul>

<h3><a name="V3.50_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- The name of the new 24-bit TIFF driver was incorrect in one place.
(vms.mak)

</pre><h3><a name="V3.50_Utilities"></a>Utilities</h3><pre>

Adds a new utility to put a caption in a box at the bottom of each page.
(caption.ps)

</pre><h3><a name="V3.50_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The PC display devices weren't page devices.  Probably all the
other display and window system devices should be made page devices too, but
we aren't going to bother tracking them down.  (gdevpcfb.c)
	- There was a lot of duplicated code in the TIFF drivers.
(gdevtifs.h, gdevtfax.c, gdevtfnx.c, gdevtifs.c)

Updates the bjc600 / bjc800 drivers with changes from the author.
(devices.doc, gdevbjc.h, gdevcdj.c)

</pre><h3><a name="V3.50_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Building with COMPILE_INITS=1 produced a stackunderflow error.
(gs_pdf_e.ps)
	- An internal operator didn't have a name.  (ztoken.c)
	- Some error and information messages weren't in the Adobe format.
(gs_fonts.ps, gs_init.ps)
	- Some common Adobe compatibility operators weren't implemented:
pagemargin, pageparams, setpagemargin.  (gs_statd.ps, gs_lev2.ps)
	- setpageparams set Margins rather than PageOffset.  (gs_lev2.ps)
	- setpage and setpageparams didn't set Orientation.  (gs_lev2.ps)
	- If the end of an input buffer fell just after the / of a literal
name, a memory access error could occur.  (iscan.c)
	- When the interpreter returned from gs_[main_]run_string_continue,
there could be an extra value on the operand stack.  (iscan.h, istream.h,
interp.c, iscan.c, zfileio.c, zfproc.c, zpaint.c, ztoken.c)
	- If the character cache was disabled, or if a character was too
large to be cached, returning from a font BuildChar procedure could do an
erasepage.  (zchar.c)

A minor change was required for compatibility with the library change for
image devices.  (zdevice.c)

Adds a -dSHORTERRORS switch that changes some of the common error and
warning messages for greater Adobe compatibility.  (gs_init.ps, gs_fonts.ps)

</pre><h3><a name="V3.50_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- If a CharProc for a Type 3 font did a BT/ET, the graphics state
could get confused.  (gs_pdf.ps)
	- If a Tf occurred inside a BT/ET, it didn't take effect on
subsequent BT/ETs.  (gs_pdf.ps)

</pre><h3><a name="V3.50_Library"></a>Library</h3><pre>

Fixes bugs:
	- There was no way to control whether an image device was a page
device.  Fixing this required a NON-BACKWARD-COMPATIBLE CHANGE to
gs_makewordimagedevice and gs_initialize_wordimagedevice to take a Boolean
page_device argument.  Fortunately, this change affects only a few obscure
library clients.  (gsdevice.h, gsdevmem.c)

Adds translation capability to clipping devices.  This isn't used anywhere
yet.  (gxcpath.h, gxcpath.c)

Adds procedures for doing unaligned copy_xxx operations.  These were added
for a customer.  (gxdevice.h, gsdevice.c)

Changes the (undocumented) return value of gs_setcachedevice[2]: they used
to return 1 if the current show operation was a non-displaying one
(stringwidth or cshow), and now return 1 if the cache device was just
installed.  This change was required to fix the BuildChar page clearing bug
in the interpreter.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE, but as far as
I know, there aren't any external clients of these routines.  (gschar.h,
gschar.c)

</pre>

<hr>

<h2><a name="Version3.49"></a>Version 3.49 (limited) (9/20/95)</h2>

<p>
This is another bug-fix release during beta test.  There are other bugs
outstanding, but the ones I know about right now are all platform-specific.

<h3><a name="V3.49_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- make.doc didn't mention that the .def files are needed to build a
MS Windows executable.  (make.doc)

</pre><h3><a name="V3.49_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- There were some forward references to macro definitions in the
makefiles.  (int.mak, lib.mak)
	- The default device for library configurations was the null page
device, not the first device in DEVICE_DEVS.  (ugcclib.mak)

</pre><h3><a name="V3.49_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The BJC600 / BJC800 drivers were missing a header file.
(gdevbjc.h, gdevcdj.c)
	- A procedure name was used in two different files.  (gdevcdj.c)
	- The PCX driver didn't return an error code in case of failure.
(gdevpcx.c)
	- The X Windows driver produced some confusing warning messages.
(gdevxini.c)
	- Some names were duplicated between drivers.  (gdevepsc.c)
	- The X driver maintained its own, peculiar initial matrix even if
Ghostview wasn't involved.  (gdevx.c)

With the permission of the author, changes the 24-bit TIFF license from GNU
to Aladdin.  (gdevtfnx.c)

</pre><h3><a name="V3.49_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS build scripts were out of sync with the makefiles (again).
(modules.lis, vms.mak)

</pre><h3><a name="V3.49_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- When the requested media size matched an available size exactly
with a 90 degree rotation, Orientation was ignored.  (zmedia2.c)

Makes zcurrentdevice extern.  (opextern.h, zdevice.c)

</pre><h3><a name="V3.49_Library"></a>Library</h3><pre>

Fixes bugs:
	- A couple of places used memcpy instead of memmove.  (gxclread.c)
	- If a bitmap image was compressed with RLE compression in a band
list, it would cause an error on decompression.  (gxclread.c)
	- The representation of colors in the band list was needlessly
inefficient.  (gxcldev.h, gxclist.c, gxclread.c)
	- When using colored halftones, snowflak.ps crashed with an invalid
memory access.  More generally, any use of halftones could cause the garbage
collector to make an invalid access.  (gsstate.c)

Adds some more code for paths in band lists, but again doesn't activate it.
(gxcldev.h, gxpath.h, gzline.h, gsline.c, gspath1.c, gxclist.c, gxclread.c,
gxpath.c)

</pre>

<h2><a name="Version3.48"></a>Version 3.48 (limited) (9/17/95)</h2>

<p>
This is the second bug-fix release during beta test.  Among other things, it
fixes a bug introduced in 3.47 that caused all PDF files to give an error.

<p>
******NOTE: the BJC600 and BCJ800 drivers do not work in this release,
because we didn't get a file from the author in time.  They will compile,
but not run.  This will be fixed in the next round.

<h3><a name="V3.48_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- Alan Barclay's contact information was wrong.  (README)

</pre><h3><a name="V3.48_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The linker path for Watcom C++ 10.5 was wrong.  (wccommon.mak)
	- There was a syntax error in a batch file.  (pdf2ps.bat)
	- The VMS build script didn't have entries for some printers.
(vms.mak)

Adds the bjc600 and bjc800 devices on all platforms that already include the
color DeskJet devices.  (*.mak)

</pre><h3><a name="V3.48_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The H-P drivers didn't reposition the cursor properly at the
beginning of pages after the first page, causing the image to be shifted
down slightly and cut off at the bottom.  (gdevdjet.c)
	- The x11alpha driver was extremely slow.  (gdevxalt.c)
	- The -g switch by itself didn't work for the X Windows driver.
(gdevxini.c)
	- .installpagedevice can get a rangecheck on MS Windows because the
HWColorMap can change spontaneously.  (gs_setpd.ps)

Updates the bjc600 and bjc800 drivers with new versions from Yves Arrouye.
(gdevcdj.c)

Adds a user-contributed driver that writes uncompressed 24-bit RGB TIFF
images in a format that is standard on NeXT platforms.  This driver is
governed by the GNU license and is therefore separated from the rest of the
Aladdin distribution.  (gdevtfnx.c)

</pre><h3><a name="V3.48_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- There was an undefined reference to clock_gettime on some Unix
systems.  (gp_unix.c)
	- The new gp_fopen routine had several errors.  (gp_vms.c)

</pre><h3><a name="V3.48_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Some routines that should be main-instance-specific weren't.
(imain.h, main.h, gsmain.c)
	- sethalftone with a Type 2 or Type 4 halftone didn't work on CMYK
devices.  (zht2.c)
	- Setting A4 paper as the default in gs_init.ps, or specifying
-dPAPERSIZE, conflicted with -g.  (gs_init.ps)
	- The maximum value of a single-precision float wasn't correct on
VAX systems.  (math_.h, iscannum.c)
	- Some integer expressions were passed as floating point arguments.
(gs.c, zmedia2.c)
	- Media selection in setpagedevice was broken (again), as of 3.46.
(gs_setpd.ps, zmedia2.c)

</pre><h3><a name="V3.48_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Substituted color spaces caused an error.  (gs_pdf.ps,
pdf_draw.ps)

</pre><h3><a name="V3.48_Library"></a>Library</h3><pre>

Fixes bugs:
	- If a halftone had no non-default components that matched the
device's primary colors, the result would be a solid color rather than a
halftone using the default screen.  (gsht.c)
	- sethalftone with a Type 2 or Type 4 halftone didn't work on CMYK
devices.  (gxht.h, gsht.c, gsht1.c)
	- The new gp_fopen routine wasn't being used.  (gsiodev.c)
	- A mixing of float and fixed values caused a clipping region to be
possibly incorrect by up to 1 pixel.  (gspaint.c)
	- A function definition was inconsistent with the prototype.
(gspath1.c)

Adds preliminary code for including paths in band lists, but doesn't
activate any of it.  (lib.mak, gxcldev.h, gxclist.c, gxclread.c)

</pre>

<h2><a name="Version3.47"></a>Version 3.47 (limited) (9/14/95)</h2>

<p>
This is a bug-fix release during beta test.  It is meant to have no new
functionality, although in the case of setpagedevice that's stretching
things a little.

<h3><a name="V3.47_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The Mac documentation still referred to IJG JPEG v5a rather than
v6.  (make.doc)
	- The RasterOp texture device was identified incorrectly.
(gdevmrop.c)
	- use.doc and psfiles.doc didn't mention the PDF-related files.
(psfiles.doc, use.doc)
	- psview is no longer available.  (README)
	- current.doc didn't document the recognized setpagedevice keys.
(current.doc)

</pre><h3><a name="V3.47_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- Many utility programs weren't included in the Unix 'install' list.
(unix-end.mak)
	- It wasn't at all convenient to make configurations without the BCP
or other non-standard filters.  (*.mak, int.mak, modules.lis, zfilter2.c,
zfilterx.c)
	- The gconfig.c and iconfig.c files weren't deleted after
compilation.  (int.mak, lib.mak)
	- unix-end.mak referred to the nonexistent macros INT{1,2}_MAK.
(unix-end.mak)
	- The rules for building the dfax drivers were incorrect.  (devs.mak)
	- Omitting filter.dev produced an undefined reference.  (int.mak)

Adds a customer-contributed makefile for Microsoft Visual C++ 2.n under
Windows NT.  (msvcwint.mak)

</pre><h3><a name="V3.47_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- The JPEG utility didn't support the new progressive JPEG modes,
and didn't invert Adobe Photoshop output as needed.  (viewjpeg.ps)
	- The printafm utility had a single font name wired in.  (printafm,
printafm.ps)
	- The CIE lookup simulation had several bugs.  (docie.ps)
	- pdf2ps[.bat] were missing from the fileset.
	- Files produced by pdf_2ps didn't include the GS_PDF ProcSet.
(gs_pdf.ps, pdf_2ps.ps, pdf_base.ps, pdf_main.ps)

</pre><h3><a name="V3.47_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Bits read back from an EGA or VGA device were incorrect.
(gdevpcfb.c)
	- The 24-bit PCX run length compressor used a slow algorithm.
(gdevpcx.c)
	- gdevstc.c wouldn't compile with the Borland compiler.  (gdevstc.c)
	- There was a typo in the OS/2 PM driver.  (gdevpm.c)
	- .installpagedevice gets a rangecheck on X Windows because the
HWColorMap can change spontaneously.  (gs_setpd.ps)
	- The left margin for the DeskJet 500 was wrong.  (gdevdjet.c)
	- The two notions of "margin" (offset of 0,0 from physical page
corner vs. unprintable area around edges of physical page) were still
confused.  We've now fixed this for the H-P monochrome printers, but it's
probably still confused for all other printers.  (gdevprn.h, gdevdjet.c)

</pre><h3><a name="V3.47_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The Windows print spooler header file wasn't included when it
needed to be, and some other Win32-specific changes were missing.
(gsdll32.def, gp_mswin.c)
	- Windows DLLs didn't parse "s in the command "arguments" correctly.
(gsdll.c)

</pre><h3><a name="V3.47_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- FAKEFONTS could get the font directories into inconsistent states.
(gs_dps1.ps, gs_fonts.ps)
	- The substitutions for Adobe's Myriad and Minion fonts weren't
appropriate.  (gs_fonts.ps)

</pre><h3><a name="V3.47_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- If pathforall got an error computing the user-space points on a
path, it could cause an invalid access.  (zpath1.c)
	- A 'private' declaration were omitted.  (Why doesn't gcc catch
this??)  (zcie.c)
	- Setting GS_FONTPATH produced a stackunderflow error.
(gs_fonts.ps)
	- currentscreen caused a typecheck if the screen had been set by
setcolorscreen.  (gs_dps1.ps)
	- setcolorrendering tried to cache values computed from the color
space even if the current color space wasn't a CIE space.  (zcrd.c)
	- Out-of-range numbers like 10E38 caused a floating point exception.
(iscannum.c)
	- Giving a closed readable file as input for a filter caused an
invalidaccess.  (files.h, interp.c, zfilter.c)
	- setpagedevice opened the default device even with -dNODISPLAY.
(gs_init.ps, gs_setpd.ps)
	- realtime returned the same value as usertime.  (gs_lev2.ps,
zmisc.c)
	- Storing a local value into systemdict caused some redundant code
to be executed.  (zdict.c)
	- Files with a very long first line could cause a rangecheck error.
(gs_init.ps)
	- The PageOffset page device parameter was ignored.  (gs_setpd.ps)
	- The Orientation page device parameter wasn't handled properly.
(gs_setpd.ps, idparam.h, idparam.c, zmedia2.c)
	- setpagedevice could set device parameters twice, with an
incomplete update the first time.  (gs_setpd.ps)

</pre><h3><a name="V3.47_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Readers confused the internal pdfrun procedure with the public
runpdf procedure.  (pdf_*.ps)

</pre><h3><a name="V3.47_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- Closed streams had a NULL state pointer, causing problems for some
clients.  (stream.c)
	- Group 4 decoding could get an ioerror if an end-of-buffer occurred
in a horizontal code sequence between a makeup code and the termination
code.  (scfd.c)

</pre><h3><a name="V3.47_Library"></a>Library</h3><pre>

Fixes bugs:
	- Some 'private' declarations were omitted.  (Why doesn't gcc catch
these??)  (gdevmrop.c, gxht.c)
	- Patterns could produce bad output in the band list.  (gxclist.c)
	- RasterOp wasn't implemented at all for 2- or 4-bit devices.  (In
this release, we implement only a subset, and without handling transparency
properly.)  (gdevm2.c, gdevm4.c, gdevmrop.c)
	- Drawing operations and text sometimes didn't apply the RasterOp
when they should, and vice versa.  (gxdcolor.h, gxdraw.c)
	- setcolorrendering tried to cache values computed from the color
space even if the current color space wasn't a CIE space.  (gscie.h,
gscie.c)
	- Some CIE color spaces produced very distorted colors.  (gscie.c)
	- setpagedevice opened a window even with -dNODISPLAY.  (gsdevice.c,
gsdparam.c)
	- realtime returned the same value as usertime.  (gp.h, time_.h,
gp_*.c)
	- The library level attempted to handle the Orientation page device
parameter.  (gxdevice.h, gdevbit.c, gsdevice.c, gsdparam.c, gspath.c)
	- Severely non-linear CIE encoding/decoding functions produced
seriously skewed colors near the ends of the color value range.  This
problem can now be alleviated, at a significant cost in performance, by
changing configuration parameters at the beginning of gscie.h.  (gscie.h,
gscie.c)
	- Files FTP'ed in binary mode weren't being opened properly on VMS.
(gp.h, gp_*.c, gsiodev.c)
	- A header file had an inconsistent declaration.  (math_.h)

Adds a new gp_get_usertime procedure to gp.h.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE, affecting only platform implementors.  It
was necessary to fix the realtime/usertime bug.  (gp.h, time_.h, gp_*.c)

Adds a new gp_fopen procedure to gp.h.  THIS IS A NON-BACKWARD-COMPATIBLE
CHANGE, affecting only platform implementors.  It was necessary to fix the
binary file problem on VMS.  (gp.h, gp_*.c)

</pre>

<h2><a name="Version3.46"></a>Version 3.46 (limited) (9/4/95)</h2>

<p>
This is the "serious beta test" release for the next public release.  It
finishes implementing RasterOp in the graphics state, and the remaining
commonly used parts of setpagedevice.

<h3><a name="V3.46_Documentation"></a>Documentation</h3><pre>
Documents some possible problems when building with DJGPP v2.0-beta.
(make.doc)

Adds documentation on using Ghostscript as a PDF interpreter.  (use.doc)

Notes linking problems with the Watcom 10.0 environment.  (make.doc)

</pre><h3><a name="V3.46_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The rule for $(ccfonts).dev was wrong.  (gs.mak)

Makes some additional filters into 'features'.  (devs.mak, gs.mak)

Splits off 2 new makefiles from gs.mak, which had gotten very large: lib.mak
(graphics library) and int.mak (interpreters).  (tar_cat, tar_cat.bat,
*.mak)

Adds a new 'config-clean' target that may be helpful in changing
configuration definitions.  (gs.mak)

Notes in the relevant makefiles that on Unix and DVX systems, one should not
edit 'makefile' or the concatenated makefile, but should edit the individual
subfile and run tar_cat.  (ansihead.mak, cc-head.mak, dgc-head.mak,
gcc-head.mak, devs.mak)

Updates the Watcom makefiles to handle Watcom release 10.5, in which many
executables moved to different directories.  (watc.mak, watcwin.mak,
wccommon.mak)

Adds a pdf2ps shell script.  (pdf2ps, pdf2ps.bat)

Adds a -sFONTMAP= switch to specify the name of the Fontmap file.
(gs_fonts.ps)

Adds a -u&lt;name&gt; switch to undefine a name from systemdict.  (interp.h, gs.c,
iinit.c)

Adds a -dFIXEDRESOLUTION switch to parallel -dFIXEDMEDIA.  Makes -g set
FIXEDMEDIA and -r set FIXEDRESOLUTION.  (gs_init.ps, gs_setpd.ps, gs.c)

Changes some build procedures to avoid problems with read-only source files.
(gs.mak, int.mak, lib.mak)

</pre><h3><a name="V3.46_Utilities"></a>Utilities</h3><pre>

Adds a utility for emulating the CIE color mapping algorithms.  (docie.ps)

</pre><h3><a name="V3.46_Drivers"></a>Drivers</h3><pre>

Changes the x11alpha device so that it uses 32-bit pixels with 8 bits of
alpha.  (gdevxalt.c)

Updates the Epson Stylus Color driver to Gunther Hess's release 1.17.
(devs.mak, unix-end.mak, devices.doc, stcolor.ps, gdevstc.h, gdevstc*.c)

Updates the alternate X drivers for the change from PageSize to MediaSize.
(gdevxalt.c)

Makes Duplex an optional parameter of printer devices rather than of all
devices.  (gdevprn.h, gxdevice.h, gsdparam.c, gdevdjet.c, gdevprn.c)

</pre><h3><a name="V3.46_Platforms"></a>Platforms</h3><pre>

Makes pipes (%pipe% file syntax) a selectable option on Unix platforms,
rather than always being included.  (ansihead.mak, cc-head.mak,
gcc-head.mak, ugcclib.mak, unixtail.mak)

</pre><h3><a name="V3.46_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- colorimage, and the dictionary form of image with
MultipleDataSources = true, didn't check that all the data sources were of
the same type.  (zpaint.c)
	- colorimage, and dictionary-type images with MultipleDataSources =
true, usually didn't work properly with files.  (zpaint.c)
	- grestoreall left a dangling pointer to the transfer function
cache.  (gsstate.c)
	- Changes made by setpagedevice could get 'lost' and not installed
in the current page device dictionary.  (gs_setpd.ps)
	- The Install procedure was called before the new page device
dictionary had gotten installed.  (gs_setpd.ps)
	- If a grestore/grestoreall/restore/setgstate operation switched
page devices, the new page device didn't get installed properly.
(gs_setpd.ps, opextern.h, zdevice2.c, zdps1.c)
	- If the current screen was a Type 1 halftone, currentscreen and
currentcolorscreen returned frequency = 60, angle = 0 rather than the
Frequency and Angle from the halftone (see Adobe TN 5085).  (gs_dps1.ps,
gs_init.ps)
	- setscreen with a Type 1 halftone dictionary didn't insert the
frequency and angle into the dictionary (see Adobe TN 5085).  (gs_dps1.ps)
	- upath didn't include a trailing moveto in the bounding box.
(gs_dps1.ps, zpath1.c)
	- setpagedevice didn't automatically rotate or scale the image when
necessary.  (gs_setpd.ps, zmedia2.c)

Moves the RasterOp operators to a separate file.  (iutil.h, iutil.c,
zgstate.c, zrop.c)

Eliminates the unnecessary "wrapper" around .setdevice.  (zdevice2.c)

Establishes the convention that all interpreter callbacks into PostScript
code use procedure names that begin with %; documents this in gs_init.ps.
Changes Type1BuildChar and Type1BuildGlyph to %Type1BuildChar and
%Type1BuildGlyph.  (gs_init.ps, gs_type1.ps, zfont0.c, zfont1.c)

Changes image / imagemask / colorimage for the new library API.  (zimage2.c,
zpaint.c)

Reorganizes font loading to make compiled fonts and Fontmap interact better
with each other.  (gs_ccfnt.ps, gs_fonts.ps, gs_init.ps, gs_res.ps)

Implements parameter collection for the new CIEBasedDEF[G] color spaces, but
doesn't actually implement the color spaces themselves.  (icie.h, zcie.c,
zcrd.c)

Renames iconfig.c as iconf.c to avoid problems with read-only source files.
(iconf.c)

</pre><h3><a name="V3.46_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- PDF to PostScript conversion didn't work.  (pdf_main.ps)

Shifts most of the work in the PDF interpreter from the reader to the
ProcSet.  This simplifies the code considerably and also makes it easier to
modify.  (gs_pdf.ps, pdf_draw.ps, pdf_font.ps, pdf_main.ps)

</pre><h3><a name="V3.46_Library"></a>Library</h3><pre>

Fixes bugs:
	- 'static' was omitted in a place that some compilers require it.
(gxccman.c)
	- Some compilers don't allow a variable with the same name as a
preprocessor macro with arguments.  (gscie.c)
	- Some places did a "return -1" rather than a proper error return.
(gsdevice.c, gxclist.c)
	- An external declaration had a typo.  (gsrop.h)
	- An extra semicolon upset some compilers.  (gzpath.h)
	- Printer devices that didn't use the standard macros for generating
their procedure vector wound up being considered as non-page devices.
(gdevprn.c)
	- Some compilers truncated identifiers longer than 31 characters.
(gscspace.h, zcie.c, gscie.c)
	- upath didn't include a trailing moveto in the bounding box.
(gspath.h, gspath1.c)
	- RasterOp value 126 returned an incorrect result.  (gsroptab.c)

Finishes implementing RasterOp in the graphics state.  (gdevmrop.h, gsrop.h,
gsropt.h, gsstate.h, gxbitmap.h, gxcindex.h, gxdcolor.h, gxdevice.h,
gzstate.h, gdevmrop.c, gscolor.c, gsdevice.c, gsimage.c, gsimage1.c,
gsimage2.c, gsimage3.c, gspcolor.c, gsrop.c, gsstate.c, gxacpath.c,
gxccache.c, gxcht.c, gxcmap.c, gxdither.c, gxdraw.c, gxht.c)

Changes forwarding devices so they forward get_bits by default.  This
probably doesn't affect any existing code.  (gxdevice.h, gsdevice.c)

Changes the API for gs_image[mask]_init to pass a structure rather than a
very large number of scalars.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE,
motivated by the addition of further image parameters to support RasterOp.
Since there are no external clients of the library yet, it shouldn't matter.
(gsimage.h, gsimage.c, gslib.c, gxccache.c)

Redefines the device "page size" as being the size of the actual media,
changing the name of the gx_device PageSize member to MediaSize, the name of
the PageSize device parameter to .MediaSize (but keeping PageSize as
equivalent, for backward compatibility), and the name of the
gx_device_set_page_size procedure to gx_device_set_media_size (keeping the
old name as a macro).  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.  It is
necessary to make setpagedevice work, and to avoid confusion about what
"page size" means.  It potentially affects any device driver, but almost
none of the device drivers distributed with Ghostscript are affected, and
those have been updated.  (gsparam.h, gxdevice.h, gsdevice.c, gsdparam.c,
gspath.c)

Renames gconfig.c as gconf.c to avoid problems with read-only source files.
(gconf.c)

Adds an API procedure for setting a bitmap pattern.  (gscolor2.h,
gspcolor.c)

</pre>

<h2><a name="Version3.45"></a>Version 3.45 (limited) (8/27/95)</h2>

<p>
The purpose of this release is to fix some minor bugs reported by commercial
licensees, and to add two enhancements: optional RenderTable interpolation
for CIE color, and reducing the temporary space used during character
caching (also for a licensee).

<h3><a name="V3.45_Documentation"></a>Documentation</h3><pre>

Notes that the only valid return values from get_alpha_bits are 1, 2, and 4.
(drivers.doc)

Notes that the get_bits driver procedure will return a pointer to aligned
data, but does not require the caller's data area to be aligned.
(drivers.doc)

</pre><h3><a name="V3.45_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- Many of the printer and file output drivers in devs.mak still
included gdevprn.$(OBJ) in their dependencies.  (devs.mak)
	- PDEVH was used before it was defined.  (devs.mak)
	- GENCONF_XE was used before it was defined.  (unixhead.mak,
unix-end.mak)

Makes it possible to switch sfile implementations without editing gs.mak.
(gs.mak)

Makes it possible to specify alternate compiled font tables without editing
gs.mak.  (gs.mak)

Allows quoted arguments in @-files, e.g.,
	-sOutputFile="a file name with spaces"
(gs.c)

</pre><h3><a name="V3.45_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- The ps2ascii script could fail to delete temporary files in case
of an abnormal exit.  (ps2ascii)

</pre><h3><a name="V3.45_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The MS Windows printer capability test was wrong.  (gdevwpr2.c)
	- The MS Windows and OS/2/PM displays weren't page devices.
(gdevwdib.c, gdevpm.c)

Gets rid of all direct references to dev-&gt;PageSize in drivers.  (gdevl256.c,
gdevvglb.c)

</pre><h3><a name="V3.45_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The 32-bit MS Windows configuration file for the Borland C++
compiler was missing from the fileset.  (bcc32.cfg, tar_gs)

Makes the printer devices in the OS/2 implementation capable of outputting
directly to the print spooler.  (use.doc, gp_os2.c)

Makes printing on Windows NT and Windows 95 use the printer queue.
(gp_mswin.c, gswin32.rc)

</pre><h3><a name="V3.45_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Copying a null device produced an uninitialized pointer.
(gsdevice.c)
	- The dictionary returned by deviceinfo wasn't read-only.
(gs_lev2.ps)
	- If a filter's init code failed, an entry on the operand stack
(usually the top) could be smashed.  (files.h, zfile.c, zfilter.c)

Adds const in a few places that needed it.  (zwppm.c)

Adds interpolation to the CIE RenderTable lookup.  (icie.h, zcie.c, zcrd.c)

</pre><h3><a name="V3.45_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Allows PDF files with control-character garbage at the end, and up to 250
characters of garbage at the beginning.  The latter is only supported by
runpdf, not by run.  (pdf_base.ps, pdf_main.ps)

</pre><h3><a name="V3.45_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- A 1-D CCITTFaxDecode stream could give an error if an input buffer
boundary fell just before a 0-length termination code.  (scfx.h, scfd.c)

</pre><h3><a name="V3.45_Library"></a>Library</h3><pre>

Fixes bugs:
	- A variable was used before being set, which could cause band
devices to become confused when processing colored halftones.  (gxclist.c)
	- Some of the color and tile bookkeeping for band lists was wrong
(as of 3.44), causing tiled areas to be filled with garbage.  (gxclist.c,
gxclread.c)
	- Colored Patterns showed up blank on devices whose native
representation of `black' was a non-zero value.  The fix removes the
'cached' member of the gx_device structure, and requires monobit memory
devices to have a palette; this is a NON-BACKWARD-COMPATIBLE CHANGE for
anyone who was foolish enough to statically initialize a gx_device structure
without using the macros in gxdevice.h or gdevprn.h.  (gdevmem.h,
gxdevice.h, gxdevmem.h, gdevm1.c, gdevmrop.c, gsdevice.c, gxcpath.c,
gxdither.c)

Provides the framework for band devices to implement alpha (anti-aliasing).
(gxcldev.h, gdevprn.c, gsdevice.c, gxclist.c, gxclread.c)

Implements an efficient API for enumerating paths using device coordinates.
(gspath.h, gxpath.h, gzpath.h, gspath1.c, gxpath2.c)

Changes the character cache logic so that when rasterizing large
anti-aliased characters, it converts the oversampled bits to alpha values on
the fly rather than waiting until it has rasterized the entire character.
This saves a lot of temporary space, at the expense of some extra time and
lower quality results for Type 3 characters that don't use a single fill or
imagemask operation to draw the character.  This enhancement requires adding
a member to the gx_device structure (max_fill_band), which is a
NON-BACKWARD-COMPATIBLE CHANGE for badly written drivers (see above).
(gxchar.h, gxdevice.h, gxpaint.h, gdevabuf.c, gschar.c, gspaint.c,
gxccache.c, gxccman.c, gxfill.c)

Changes the palette member of memory devices from gs_string to
gs_const_string.  (gdevmem.h, gxdevmem.h, gdevmem.c, gdevm1.c)

Starts to decouple halftoning from the graphics state machinery, so
it can be applied after banding rather than before.  (gxdcolor.h,
gxdht.h, gxdither.h, gzht.h, gxcmap.c, gxdither.c, gxdraw.c)

Starts to decouple path filling from the graphics state machinery, so
that we can pass paths through band lists.  (gxpaint.h, gxfill.c)

Adds interpolation to the CIE RenderTable lookup.  This is optional, enabled
by #define CIE_RENDER_TABLE_INTERPOLATE in gscie.h.  (gscie.h, gxctable.h,
gscie.c, gxctable.c)

</pre>

<h2><a name="Version3.44"></a>Version 3.44 (limited) (8/21/95)</h2>

<p>
This includes a few bug fixes, but its main purpose is to add two new
features: monobit and 8-bit gray-scale RasterOp (at the driver level, not at
the gstate level yet), and (compressed) band lists in RAM.  Of course, these
new features may have introduced new bugs!

<h3><a name="V3.44_Documentation"></a>Documentation</h3><pre>
Adds contact information for a user working on NeXT machines.  (README)

Notes that Ghostscript runs on FreeBSD.  (README)

Adds copy_rop (the RasterOp operation) to the driver interface.
(drivers.doc)

Adds FONTPATH information for more operating systems.  (use.doc)

</pre><h3><a name="V3.44_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The tar_cat script needed a #!/bin/sh to execute correctly on all
platforms.  (tar_cat)
	- There were a number of minor errors in the makefiles.  (gs.mak,
unixhead.mak)
	- Level 2 configurations without command lists had two undefined
references.  (gs.mak)
	- Some shells required an extra ';' to terminate an 'if' command.
(ugcclib.mak, unix-end.mak, unixtail.mak)

Updates the JPEG code to the officially released version 6 of the IJG
library.  See jpeg.mak for information on where to find this library.
(jpeg/*, jpeg.mak, *.mak, modules.lis)

Adds a definition of XEAUX to the makefiles to parallel CCAUX, primarily for
cross-compilation environments.  All references to &lt;some-program&gt;$(XE) must
be replaced by $(&lt;SOME-PROGRAM&gt;_XE), where some-program={$(GS), ansi2knr,
echogs, genarch, genconf, geninit}.  This is a NON-BACKWARD-COMPATIBLE
CHANGE, required in order for the makefiles to work in cross-compiled
environments.  (For non-cross-compiled environments, it currently doesn't
matter.)  (gs.mak, *.mak)

</pre><h3><a name="V3.44_Utilities"></a>Utilities</h3><pre>

Updates ps2ai.ps to version 2.13.  (ps2ai.ps)

Changes all the utility shell scripts to include #!/bin/sh, to use exec, and
to pass the original arguments using "$@".  (bdftops, font2c, gsbj, gsdj,
gslj, gslp, gsnd, wftopfa)

</pre><h3><a name="V3.44_Drivers"></a>Drivers</h3><pre>

Adds the requirement that all page-oriented devices (i.e., those that use
gdevprn.h and implement the print_page procedure) include page.dev in their
dependencies and use $(SETPDEV) rather than $(SETDEV) in their makefile rule
bodies.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.  Without this change, the
command list logic (over 25K of unnecessary object code) would have to be
included in every configuration.  (gs.mak, devs.mak, echogs.c)

Adds a user-contributed driver for the Okidata Microline (IBM compatible)
dot matrix printers.  (gdevokii.c)

Adds copy_rop (the RasterOp operation) to the driver interface.  Currently,
only monobit and 8-bit gray-scale devices implement it.  (gxdevice.h,
gsdevice.c)

Adds the ability to read back bits from the display to the x11 devices.
(x_.h, gdevx.c, gdevxalt.c)

</pre><h3><a name="V3.44_Platforms"></a>Platforms</h3><pre>

Makes some minor changes to support QNX.  (stat_.h)

Removes the mswinprn driver from the 16-bit Windows configuration, because
the 64K default data segment overflowed.  (bcwin.mak)

</pre><h3><a name="V3.44_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Type 1 fonts didn't accept packed arrays for Subrs or OtherSubrs.
(zchar1.c, zfont1.c)
	- TBCP-encoded files (yes, I know there isn't supposed to be any
such thing) didn't automatically activate TBCP decoding.  (gs_init.ps)
	- Fonts with invalid FID entries weren't detected.  (zfont.c)

Speeds up dictionary operations slightly by removing redundant checks for
nulls.  (zdict.c)

Starts adding support for the new CIEBasedDEF and CIEBasedDEFG color spaces.
(gs_l2img.ps, gs_lev2.ps, igstate.h, zcrd.c)

Adds access operators for RasterOp and transparency in the graphics state.
(They don't actually do anything yet.)  (zgstate.c)

</pre><h3><a name="V3.44_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- PDFDocEncoding was missing characters 24-31.  (gs_pdf_e.ps)

Moves the definition of pdfmark from systemdict to userdict so that Adobe
PostScript files won't think the interpreter is a distiller.  (gs_pdf.ps)

</pre><h3><a name="V3.44_Library"></a>Library</h3><pre>

Fixes bugs:
	- Some JPEG images had bands of garbage alternating with bands of
valid data.  IJG v6 fixed this -- see above.
	- With FPU_TYPE = -1, the cosine routine returned incorrect values
for angles above 270 degrees.  (gsmisc.c)
	- CIE color conversion didn't work on 16-bit systems.  (gscie.h,
gscie.c)

Partially implements reducing the intermediate space for rasterizing
anti-aliased characters by compressing the oversampled representation to an
alpha array incrementally.  (gdevmem.h, gxchar.h, gxdevmem.h, gdevabuf.c,
gschar.c, gspaint.c, gxccman.c)

Starts adding support for the new CIEBasedDEF and CIEBasedDEFG color spaces.
(gscie.h, gscspace.h, gscie.c)

Completes the implementation of band lists in RAM.  To select this feature,
change the definition of cl_impl in gs.mak from clfile to clmem.  (Someday
we'll make this easier.)  (gxclmem.h, gxclmem.c)

Finishes implementing RasterOp and transparency at the driver level for
monobit and 8-bit gray-scale devices, and implements some of the framework
for general multiple-bit-per-pixel devices.  See drivers.doc for
documentation.  (gsropt.h, gxcldev.h, gxclist.h, gdevm1.c, gdevm8.c,
gdevmem.c, gdevmrop.c, gschar.c, gxclist.c, gxclread.c)

Implements the ability to include commands applicable to all bands, rather
than an individual band, in the band list.  Eventually this will be used for
passing halftones through the band list.  (gxcldev.h, gxclist.h, gxclist.c)

Adds support for 2-bit-deep 'word' memory devices.  (gdevmem.h, gxdevmem.c,
gdevm2.c)

Changes the initialization for memory devices so that they determine their
polarity from the device for which they are buffering the image (if any).
This is a subtle change.  (gdevmem.h, gdevmem.c, gdevm1.c, gsdevmem.c)

</pre>

<h2><a name="Version3.43"></a>Version 3.43 (limited) (8/10/95)</h2>

<p>
Fixes a few more minor bugs, and changes FEATURE selection back to
essentially the way it was before 3.41.

<h3><a name="V3.43_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- A ~ was missing in a URL.  (README)

Adds information about an Amiga port of Ghostscript.  (README)

Removes a file called gs.1.c, which appears to be an obsolete version of
gs.1.

Adds DCX documentation to the PCX driver.  (We don't support DCX yet, but we
might in the future.)  (gdevpcx.c)

Adds information about getting Type 1 fonts from H-P if you have an H-P
PostScript printer.  (use.doc)

</pre><h3><a name="V3.43_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The auxiliary programs wouldn't compile with ANSI compilers that
don't accept K&amp;R syntax.  (ccgs, gs.mak, ugcclib.mak, *head.mak,
unixtail.mak, echogs.c, genarch.c, genconf.c, geninit.c)

Reinstates FEATURE_DEVS in the makefiles, getting rid of FEATURE1..10.  THIS
IS A NON-BACKWARD-COMPATIBLE CHANGE, but it puts things back the way they
were before 3.41, with one exception: compiling the PostScript
initialization code into the executable is now a separate macro
COMPILE_INITS with a definition of 0 or 1, instead of the ccinit 'feature'.
(gs.mak, *.mak, fonts.doc, make.doc)

Adds a CCLEAF macro to the makefiles, for optimizing the compilation of
modules containing only leaf procedures.  (gs.mak, *.mak)

Adds a CONFIG makefile variable that helps in maintaining multiple variants
in a single directory.  (gs.mak, *.mak)

</pre><h3><a name="V3.43_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- An extern for exit() (in &lt;stdlib.h&gt;) was omitted.  (gp_vms.c)

</pre><h3><a name="V3.43_Fonts"></a>Fonts</h3><pre>

Reorganizes the compiled font facility so that fonts can be compiled and
turned into a library by third parties.  (gs.mak, font2c.ps, gs_ccfnt.ps,
ccfont.h, iccfont.c, ccfontab.c)

</pre><h3><a name="V3.43_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- internaldict was implemented as a dictionary in systemdict and an
operator in userdict, rather than as an operator in systemdict.  This caused
a noaccess error when loading certain Type 1 fonts.  (gs_init.ps,
gs_type1.ps)
	- xfonts couldn't handle modified encodings.  (zfont2.c)

Changes the build date printout in the help message to YYYY-MM-DD.  (gs.c)

Adds native support for Multiple Master fonts (WeightVector).  (zfont1.c)

Implements sin and cos more efficiently (by table lookup with linear
interpolation) on machines with slow (or no) floating point.  (zmath.c)

Separates out the code for 'reading' the .ps initialization files, for the
new COMPILE_INITS arrangement.  (imain.h, gconfig.c, gsmain.c, iconfig.c,
iccinit0.c, iinit.c)

</pre><h3><a name="V3.43_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The CCITTFaxDecode filter could read up to 3 bytes beyond EOD.
This fix doesn't quite cover all cases, but at least it makes things better.
(ghc.h, sbhc.c, scfd.c)

</pre><h3><a name="V3.43_Library"></a>Library</h3><pre>

Fixes bugs:
	- After a nocurrentpoint error from a show operation with a
composite font, the bookkeeping was confused and could cause an access
error.  (gschar.c)
	- xfonts couldn't handle modified encodings.  (gsccode.h, gxchar.h,
gxfont.h, gxxfont.h, gschar.c, gxccache.c)

Makes .charboxpath able to use cached character information.  (gxchar.h,
gschar.c)

Adds native support for Multiple Master fonts (OtherSubrs 14-18).
(gxfont1.h, gstype1.c)

Improves the hashing functions for the character cache.  (gxfcache.h,
gxccman.c)

Adjusts the character oversampling algorithm to reduce thickening for
devices with alpha capability.  (gsbitops.c)

Improves the encoding of the band list for certain kinds of small
rectangles.  (gxcldev.h, gxclist.c, gxclread.c)

Implements sin and cos efficiently on machines with slow (or no) floating
point.  (gxfarith.h, gsmatrix.c, gsmisc.c, gspath1.c)

</pre>

<h2><a name="Version3.42"></a>Version 3.42 (limited) (8/2/95)</h2>

<p>
Fixes a few significant problems in 3.41, and brings the DLL code up to
date.

<h3><a name="V3.42_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- language.doc still referred to rectappend rather than .rectappend.
(language.doc)

Adds documentation on the Macintosh port.  (readme, make.doc)

Updates the DLL documentation.  (dll.doc)

Documents the BCP and TBCP filters as non-experimental.  (language.doc)

</pre><h3><a name="V3.42_Procedures"></a>Procedures</h3><pre>

Changes the build date printout to YYYY-MM-DD.  (gs_init.ps)

</pre><h3><a name="V3.42_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS build script had gotten out of sync with the makefiles
(again).  (vms.mak, modules.lis)

Brings the MS Windows and OS/2 platforms up to date with the rest of the
code, including DLL support for OS/2.  (os2.mak, gsdll*.def, gdevswn.c,
gdevpm.c, gdevwdib.c, gp_mswin.c, gp_os2.c, gsdll.c, gsmain.c)

Adds a new platform-specific routine gp_do_exit, as an alias for the C
library `exit' call.  (gp.h, gsdll.c, gsmain.c, gp_*.c)

</pre><h3><a name="V3.42_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- .forgetsave at the outermost level didn't clear the l_new bit,
causing changes to be undone improperly.  (isave.c)
	- A 'void' formal parameter list upset some compilers (as it should
have).  (gsmain.c)

Adds a .charboxpath operator that appends to the current path the bounding
boxes of the characters of a string.  (zchar.c, zchar1.c)

</pre><h3><a name="V3.42_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- A procedure was declared private inconsistently.  (siscale.c)

</pre><h3><a name="V3.42_Library"></a>Library</h3><pre>

Fixes bugs:
	- The library test program didn't do a necessary initial gsave.
(gslib.c)
	- The fix for landscape monobit images in 3.41 could smash memory.
(gsimage1.c)
	- 1-pixel-wide lines drawn with image or imagemask still disappeared
sometimes.  (gsimage.c)

Does some more preparatory work for the implementation of command lists in
RAM.  (gdevprn.h, gxclio.h, gxclist.h, gxclfile.c, gxclist.c, gxclread.c)

Adds a gs_charboxpath procedure that appends to the current path the
bounding boxes of the characters of a string.  (gschar.h, gscpm.h,
gstype1.h, gxchar.h, gxpath.h, gxtype1.h, gzstate.h, gschar.c, gspaint.c,
gstype1.c, gxpath.c)

</pre>

<h2><a name="Version3.41"></a>Version 3.41 (limited) (7/27/95)</h2>
<p>
Another incremental release with bug fixes and customer-requested
enhancements.  This release was intended to include the full setpagedevice
media matching and adjustment algorithm, but we discovered some
architectural problems during development, and have postponed it.

<h3><a name="V3.41_Documentation"></a>Documentation</h3><pre>

Replaces the build instructions for NeXTSTEP with more up-to-date and
accurate ones.  (make.doc)

Notes that some extra manual steps are required when cross-compiling.
(make.doc)

Documents how to define new 'features' in the makefile.  (gs.mak)

</pre><h3><a name="V3.41_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The build rule for ccinit.dev was circular.  Fixing this required
a small but NON-BACKWARD-COMPATIBLE change in the way that features are
selected in the makefiles (FEATURE_DEVS replaced by FEATURE1..10).  (*.mak,
fonts.doc, make.doc)

Changes the build rule for gconfig.h to be less likely to overrun MS-DOS's
command line length limit.  (gs.mak)

Adds a -dFIXEDMEDIA switch to indicate that the media size should be
considered fixed after initialization.  (gs_init.ps)

</pre><h3><a name="V3.41_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- traceimg.ps incorrectly referred to .stdout.  (traceimg.ps)
	- prfont.ps didn't display unencoded characters correctly.
(prfont.ps)
	- ps2epsi didn't give correct bounding box information.  (ps2epsi,
ps2epsi.ps)
	- ps2epsi produced DSC comments that didn't fully conform to the
Adobe standard.  (ps2epsi, ps2epsi.ps)

Allows viewpbm.ps to take multiple files on the command line.  (viewpbm.ps)

</pre><h3><a name="V3.41_Drivers"></a>Drivers</h3><pre>

Adds a preliminary, contributed PNG driver.  THIS IS NOT USABLE YET -- DON'T
TRY TO USE IT.  (png.mak, gdevpng.c)

Increases the maximum allowable scan line width for the TIFF drivers from
5183 pixels to 12863 pixels.  (scf.h)

</pre><h3><a name="V3.41_Platforms"></a>Platforms</h3><pre>

Updates the MS Windows DLL code to export the new, suspendable run_string
interface.  (gsdll.h, gsdll.c, dll.doc)

</pre><h3><a name="V3.41_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- There were several errors in cfonts.mak.  (cfonts.mak)
	- The compiled fonts option didn't offer both free and standard
configurations.  (gs.mak)
	- A bug in the handling of Encoding resources prevented compiled
fonts from working.  (gs_res.ps)

Adds a little more support for CID-keyed fonts.  They still aren't anywhere
near usable.  (gs_cidfn.ps, gs_type1.ps)

Adds a new Fontmap for Solaris 2.3.  (Fontmap.Solaris)

Adds support for Type 4 fonts (Type 1 fonts with their own BuildChar
procedures), including the CCRun procedure in internaldict.  (gs_fonts.ps,
gs_res.ps, gs_type1.ps)

</pre><h3><a name="V3.41_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- showpage and copypage didn't honor NumCopies in a page device.
(gs_setpd.ps, zdevice2.c)
	- currentpagedevice returned incorrect information if the current
device wasn't a page device.  (gs_setpd.ps)
	- currentpagedevice didn't guarantee the presence of InputAttributes
and OutputAttributes.  (gs_setpd.ps)
	- The l_new bit wasn't set properly when a dictionary changed from
packed to unpacked keys, leading to unnecessary saves.  (idict.c)
	- Streams requiring intermediate buffering could read ahead too far,
causing input data to be skipped.  (zfilter.c)
	- cshow didn't reset the font to the base font when calling the
procedure.  (zchar2.c)
	- The Install procedure in a page device didn't set the default CTM.
(gs_setpd.ps, zmatrix.c)
	- findlibfile didn't handle special files like %stdin correctly.
(zfile.c)
	- setpagedevice didn't implement media matching.  (gs_setpd.ps,
zdevice2.c, zmedia2.c, zmatrix.c)
	- Some floating point numbers didn't print out with enough digits to
read back in with the identical value.  (iutil.c)
	- Integers that overflowed 31 bits (but not 32 bits) were converted
to negative integers rather than correct positive reals.  (iscannum.c)

Removes an experimental operator that called the image scaling/interpolation
code.  (zimage2.c)

Adds a -sSUBSTFONT=&lt;fontname&gt; switch that substitutes the given font for all
unknown fonts, bypassing the normal intelligent substitution algorithm.
(gs_fonts.ps)

Adds the Revision system parameter.  (zmisc2.c)

Adds a .knownundef operator that does an undef and returns true iff the key
was formerly present.  (zdict.c)

Makes the maximum length of names be 256 if EXTEND_NAMES is being used, 16K
otherwise.  (inamedef.h, iname.c)

Adds internaldict.  (gs_init.ps, iinit.c)

Adds support for Type 4 fonts.  (bfont.h, zchar.c, zchar1.c, zfont1.c,
zfont2.c)

Changes .encodingdict to EncodingDirectory, for compatibility with Adobe
interpreters.  (gs_init.ps, gs_kanji.ps, gs_res.ps)

Adds superexec, an undocumented operator that is equivalent to exec but
suppresses all invalidaccess checks.  NOT COMPLETED YET; currently superexec
is equivalent to exec.  (zcontrol.c)

</pre><h3><a name="V3.41_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- .stderr was used but is no longer defined.  (pdf_base.ps)

</pre><h3><a name="V3.41_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- Not all streams initialized their state pointer.  (stream.c,
sfile.c, sfileno.c)

Adds a filter for the smoothed image scaling algorithm.  Eventually this
filter will require very little intermediate storage; right now it still
needs to buffer the entire intermediate image.  (siscale.h, siscale.c)

Increases the maximum allowable scan line width for the CCITTFaxEncode
filter from 5183 pixels to 12863 pixels.  (scf.h)

</pre><h3><a name="V3.41_Library"></a>Library</h3><pre>

Fixes bugs:
	- setpagedevice didn't update NumCopies correctly.  (gdevprn.c,
gsdparam.c)
	- The newly optimized code for monobit bitmaps could cause an
out-of-bounds memory access and/or make unaligned references.  (gsimage1.c)
	- setpagedevice with unknown keys could cause an /undefined error.
(gsdparam.c)
	- cshow didn't reset the font to the base font when calling the
procedure.  (gschar.h, gschar.c)
	- The Install procedure in a page device didn't set the default CTM.
(gzstate.h, gschar.c, gscoord.c, gsdevice.c)
	- Very non-linear EncodeABC procedures in a color rendering
dictionary could produce very inaccurate results.  (gscie.h, gscie.c)
	- The line_ptrs pointer in memory devices didn't get relocated if
the bitmap was moved during garbage collection, leading to memory smashing.
(gdevmem.c)
	- setpagedevice didn't implement media matching.  (gsdparam.c,
gscoord.c)
	- 'word' memory devices weren't recognized as memory devices.
(gdevmem.c)
	- makeimagedevice allocated, and then didn't free, an unnecessary
palette for monobit devices.  (gsdevmem.c)
	- The hack for 1-bit-wide images didn't work consistently,
particularly in landscape orientation.  (gsimage.c, gsimage0.c)

Adds an .IgnoreNumCopies page device parameter that causes #copies and
NumCopies to be ignored.  (gxdevice.h, gsdevice.c, gsdparam.c)

Removes the .IsPageDevice device parameter.  (gsdparam.c)

Converts the image scaling/interpolation code to a filter.  (gximage.h,
gsimage.c, gsimage0.c, gsimage3.c)

Adds support for Type 4 fonts.  (gxfont.h)

Adds a default implementation of parameter lists, designed to be usable
easily from C code.  (gsparam.h, gsparam.c)

</pre>

<h2><a name="Version3.40"></a>Version 3.40 (limited) (6/28/95)</h2>

<p>
This is another incremental limited release for delivery of a couple of
important bug fixes (pixel 'holes' in rotated images, setpagedevice errors
on some platforms) and an enhancement (architectural support for band lists
in RAM).

<h3><a name="V3.40_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The FTP location of the EMX DLLs was incorrect.  (use.doc)

</pre><h3><a name="V3.40_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- A couple of build rules for IJG v6 were omitted.  (jpeg.mak)

</pre><h3><a name="V3.40_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- prfont.ps wouldn't print more than 128 unencoded characters.
(prfont.ps)

</pre><h3><a name="V3.40_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- setpagedevice often caused /undefined errors on MS Windows and
OS/2 platforms.  (gdevmswn.c, gdevpm.c)
	- The VMS module list had gotten out of sync with the makefiles
(again).  (modules.lis)

</pre><h3><a name="V3.40_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- A couple of casts betwen char * and byte * were omitted.
(gsmain.c)
	- gs_[main_]run_file_open wasn't exported properly.  (imain.h,
main.h, gsmain.c)

</pre><h3><a name="V3.40_Streams"></a>Streams</h3><pre>

Changes the DCTEncode filter to return an error if it wasn't supplied enough
data before being closed.  (sdcte.c)

</pre><h3><a name="V3.40_Library"></a>Library</h3><pre>

Fixes bugs:
	- The coordinate computations for all filling operations were
slightly inaccurate, leading to pixel 'holes' in rotated images.  (gxdda.h,
gximage.h, gsimage*.c, gxdraw.c, gxfill.c)

Undoes an "optimization" (inlining the normal, fast case of a procedure)
that actually hurt performance.  (gxclist.c)

Refactors the command list code so that it in the future it will be able to
store command lists either in RAM or in the file system.  (gdevprn.h,
gxcldev.h, gxclio.h, gxclist.h, gdevprn.c, gxclfile.c, gxclist.c,
gxclread.c)

Changes the interface to the path filling code to take separate X and Y
adjustment values.  (gxpaint.h, gspaint.c, gxfill.c)

Makes the command list allocate a small tile cache if the device doesn't
need halftones.  (gxclist.c)

</pre>

<hr>

<h2><a name="Version3.39"></a>Version 3.39 (limited) (6/24/95)</h2>

<p>
This is again an incremental release primarily for delivery of enhancements
(suspendable string input in particular) to commercial customers, and with a
few bug fixes.

<h3><a name="V3.39_Documentation"></a>Documentation</h3><pre>
Notes that PDF files and repositioning PostScript files do not work if
Ghostscript was compiled with VAX C.  (use.doc)

Notes the requirement for EOD lookahead in decoding filters.  (strimpl.h)

</pre><h3><a name="V3.39_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- There were a number of undefined or used-before-defined variables
in the makefiles.  (devs.mak, dvx-head.mak, unixhead.mak, gs.mak)
	- Some commands in the makefile exceeded the MS-DOS limit of 120
characters.  (gs.mak)

Adds a -P and -P- switch to control whether the search path automatically
includes `.' as its first element.  Moves the default value of this choice
(SEARCH_HERE_FIRST) from gsmain.c to iminst.h.  (iminst.h, gs.c, gsmain.c,
use.doc)

Makes some makefile changes in anticipation of the IJG v6 release.  (*.mak)

</pre><h3><a name="V3.39_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- font2c generated invalid C procedure names from font names that
contained non-alphanumerics other then '-'.  (font2c.ps)
	- font2c generated a single element of incorrect type for numeric
arrays of zero length.  (font2c.ps)

</pre><h3><a name="V3.39_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS build scripts had gotten out of sync (again).  (vms*.mak,
modules.lis)

</pre><h3><a name="V3.39_Fonts"></a>Fonts</h3><pre>

Makes the FONTPATH directory scanner accept fonts that begin with
%!PS-AdobeFont or %!FontType1 with no following `-'.  (gs_fonts.ps)

</pre><h3><a name="V3.39_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- eq and ne on arrays or dictionaries required read access.
(zrelbit.c)
	- An include was missing.  (zcsindex.c)
	- .forgetsave at the outermost level didn't reset the l_new flag in
changed slots, leading to an anomalous (although perhaps not harmful) state.
(isave.c)
	- Dictionary growing or unpacking would both save and free the old
keys array, leading to a dangling reference.  (idict.c)

Changes gs_interpret so that for .quit with a negative operand &lt;= -100,
gs_interpret returns e_Fatal rather than the operand.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE, but as far as we know, it doesn't affect
anyone.  (interp.c)

Adds an API to allow feeding string input to the interpreter in pieces.
(errors.h, imain.h, main.h, gs.c, gsmain.c, interp.c, zcontrol.c, zfilter.c)

Adds new predicates .identeq and .identne that test "pointer equality", even
for numbers and strings.  (iutil.h, iutil.c, zrelbit.c)

Changes a few uses of return_error to return in places that don't lead
directly to a PostScript error.  (idict.c)

</pre><h3><a name="V3.39_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The logic for skipping up to a 0xff byte when decoding JPEG data
could skip too much.  (sdctd.c, sjpegd.c)
	- If a buffer boundary fell in the middle of, or just before, an
EOD, some decoding filters could stop reading too soon.  (sbcp.c, smtf.c,
sstring.c)

Makes some minor changes in anticipation of the IJG v6 release.
(gsjmorec.h)

</pre><h3><a name="V3.39_Library"></a>Library</h3><pre>

Fixes bugs:
	- A declaration should have been removed.  (gsdll.c)
	- The library initialization/termination API wasn't declared.
(gslib.h, gsinit.c, gsmain.c)
	- A variable and a preprocessor macro with the same name confused
VAX C.  (gxclist.c)
	- Image devices with depth 2-8 and only gray shades in the palette
didn't set color_info correctly.  (gsdevice.c)

Speeds up unrotated black-and-white images further by making them render
directly into a memory device when possible.  (gxdevmem.h, gsimage1.c)

</pre>

<h2><a name="Version3.38"></a>Version 3.38 (limited) (6/18/95)</h2>

<p>
This release incorporates several customer-requested enhancements (cleaner
separation of the graphics library from the interpreter, option for &gt;64K
names, true garbage collection of names, better handling of halftones on
band devices).  It is intended primarily for those customers, but is
intended as a dry run for the next public release.

<h3><a name="V3.38_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- gx_bitmap had not been updated to gx_tile_bitmap.
(drivers.doc)

</pre><h3><a name="V3.38_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The man page extension in the Unix makefiles was still $(manext),
not $(man1ext).  (unix-end.mak)
	- 'make clean' didn't remove gs_init.c.  (gs.mak)

Restructures the makefiles to better separate the language interpreters from
the graphics core.  (gs.mak)

Adds a -dNOPROMPT switch to suppress the end-of-page prompts (but still wait
for the user to type a newline).  This is different from -dNOPAUSE, which
suppresses both the prompts and the wait.  (gs_init.ps)

</pre><h3><a name="V3.38_Utilities"></a>Utilities</h3><pre>

Replaces the mergeini.ps program with an equivalent (actually slightly
better) version written in C.  (gs.mak, *.mak, psfiles.doc, use.doc,
geninit.c)

</pre><h3><a name="V3.38_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The color DeskJet drivers wouldn't compile with a K&amp;R compiler,
because some of the procedure definitions weren't in the restricted syntax
that ansi2knr requires.  (gdevcdj.c)
	- The color DeskJet drivers wouldn't compile because of a bug in
Sun's cc.  (gdevcdj.c)

Changes the BJ-10e(x) margins to be identical to those of the BJ-200.
(gdevbj10.c)

Changes the LaserJet margins in response to a user's request.  (gdevdjet.c)

Changes the psmono driver to produce slightly larger files that execute
faster on typical Level 1 printers.  (gdevpsim.c)

Changes the psmono driver so that it does not scale the image to fit the
page size, but instead scales it to be the same physical size on the page.
THIS IS A NON BACKWARD COMPATIBLE CHANGE.  However, for full-page images, it
will not have any visible effect.  (gdevpsim.c)

</pre><h3><a name="V3.38_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- There were some problems associated with printing in 32-bit
Windows environments.  (gp_mswin.c)
	- The IBM RS/6000 needs both &lt;time.h&gt; and &lt;sys/time.h&gt;.  (time_.h)

Adds the PDF interpreter to the standard MS Windows configuration.
(bcwin.mak)

</pre><h3><a name="V3.38_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- The entry for Courier-BoldItalic in cfonts.mak incorrectly named
it as Courier-Italic.  (cfonts.mak)
	- The files for Courier-Italic in cfonts.mak were inconsistently
named ncrri instead of ncri.  (cfonts.mak)
	- The rules in cfonts.mak covered only the fonts distributed with
the free versions of Ghostscript, omitting some of the standard set of 35.
(cfonts.mak)
	- The maximum number of stem hints per character in Type 1 fonts
wasn't large enough for complex Asian characters. (gxtype1.h)

Adds a -dNOFONTMAP switch to suppress loading the Fontmap file.
(gs_init.ps, gs_fonts.ps)

</pre><h3><a name="V3.38_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- One of the GC marking routines for halftones had a typo,
possibly leading to an invalid access.  (zht2.c)
	- The GC could store beyond the end of the mark stack,
possibly smashing some characters of a string or name.  (igc.c)
	- If the allocator allocated a new ref object from a
freelist, the bookkeeping for the current ref object could get
confused.  (ialloc.c)
	- The GC didn't remove names properly from the hash table.
(iname.c)
	- If a DOS editor added a ^Z to the end of an initialization file,
an error occurred during initialization.  (gs_init.ps)
	- If an initialization file had any lines longer than 128
characters, .skipeof would get an error.  (gs_init.ps)
	- makepattern could create structures in global VM pointing to
structures in local VM.  (zpcolor.c)
	- The default color rendering dictionary didn't specify large enough
ranges for some intermediate values.  (gs_lev2.ps)
	- Files being freed by a restore weren't unlinked properly, leading
to dangling pointers.  (zfile.c)
	- The interpreter used strlen without a prototype.  (interp.c)
	- Indexed or Separation colors with a CIE base or alternate space
didn't work.  (zcie.c)
	- The Watcom C 10.0 compiler produced incorrect code for an
overlapping structure assignment.  (zcsindex.c)

Removes limit of 64K names, if EXTEND_NAMES is defined at compile
time.  (*.mak, idebug.h, iminst.h, iname.h, gs.c, gsmain.c, idebug.c,
iname.c)

Makes the garbage collector really collect names.  (iname.h, inamedef.h,
isstate.h, igc.c, iname.c, isave.c)

Restructures some files to better separate the language interpreters
from their support code.  (gconfig.c, iconfig.c, iinit.c)

Restructures some files to better separate the language interpreters
from the graphics core.  (iastate.h, iastruct.h, ialloc.c)

Allows the operands of cshow to be in either order on the stack.  Adobe
interpreters apparently allow this, even though it's not documented.
(zchar2.c)

Adds a hack in cvs to truncate non-standard operator names, rather than
giving a rangecheck, to work around the "max err string" problem in some
common error handlers.  (ztype.c)

Changes the print string for unregistered operators from operator_0x... to
@0x....  (iutil.c)

Changes the garbage collector so it tries to allocate a large mark stack, to
avoid going into its 'slow' mode if the mark stack overflows.  (igc.c)

</pre><h3><a name="V3.38_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Stroked text used the text matrix, rather than just the
CTM, for scaling the line width, which could lead to inappropriately
wide lines.  (gs_pdf.ps)
	- Fonts based on other than a 1000-unit scale (i.e., with a
FontMatrix other than [0.001 0 0 0.001 0 0]) didn't scale Widths to
match the font scaling.  (pdf_font.ps)

Implements the PDF 1.1 color space extensions, except for Lab space.
(gs_pdf.ps, pdf_draw.ps)

Implements the Rotate key for pages.  (pdf_main.ps)

</pre><h3><a name="V3.38_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- When the garbage collector closed a file stream, the stream
incorrectly attempted to free the buffer.  (stream.c)

Separates out some stream implementations to better distinguish the
graphics core from the language interpreters.  (smtf.h, sfilter1.c,
smtf.c, srld.c, srle.c)

</pre><h3><a name="V3.38_Library"></a>Library</h3><pre>

Fixes bugs:
	- Compressing characters being entered in the cache could cause an
invalid memory access.  (gsbitops.c)
	- The setbbox bounding box check was slightly inaccurate.
(gsdps1.c)
	- makepattern could create structures in global VM pointing to
structures in local VM.  (gscolor2.h, gspcolor.c)
	- Out-of-range values during CIE color conversion led to random
results.  (gscie.c)
	- On output devices with non-inverted Y axes (such as MS Windows),
Interpolated images would smash memory.  (gsimage.c)
	- 90 degree rotated zero-width images caused an invalid memory
access.  (gsimage1.c)
	- If #copies was zero, showpage could create bogus empty output
files.  (gdevprn.c)
	- PageCount didn't take #copies into account.  (gsdevice.c)
	- Indexed or Separation colors with a CIE base or alternate space
didn't work.  (gscie.h, gscie.c)

Implements triangular line caps and joins, in anticipation of adding
a PCL5 interpreter.  (gsline.h, gxstroke.c)

Moves some procedures around for better separation of library from
interpreter.  (gsinit.c, gslib.c, gsmain.c, gsmisc.c)

Moves the standard allocator from the interpreter to the library.
(gsalloc.h, gxalloc.h, gxobj.h, gsalloc.c)

Starts to change the representation of paths slightly to make it possible to
identify arcs.  This change is backward-compatible for all code except
callers of gx_path_add_arc.  (gxpath.h, gspath1.c, gxpath.c, gxstroke.c)

Adds some framework for keeping track of RasterOp and "transparency" in the
graphics state, although these don't actually have any effect yet.
(gsrop.h, gsropt.h, gsstate.h, gxcldev.h, gzstate.h, gsrop.c, gsstate.c,
gxclist.c, gxclread.c)

Adds a compile-time option for using the Adobe RGB&lt;-&gt;CMYK conversion rules.
(gxdcconv.c)

Adds a driver procedure for identifying band devices.  This change is
backward-compatible for all existing devices.  (gdevmem.h, gxdevice.h,
gsdevice.c, gxclip2.c, gxclist.c, gxcpath.c)

Speeds up gray-scale images on devices requiring banding, and enables
further optimizations, by reintroducing the distinction between banded and
non-banded devices.  (gxdevice.h, gdevprn.c, gsimage1.c)

Reduces the size of the band list for halftoned images by encoding tile
indices more compactly.  (gxcldev.h, gxclist.h, gxclist.c, gxclread.c)

Extends the band list so it can cache more than 256 halftone tiles, and to
make better decisions about tile caching.  (gxcldev.h, gxclist.h, gxclist.c,
gxclread.c)

</pre>

<h2><a name="Version3.37"></a>Version 3.37 (limited) (5/11/95)</h2>

<p>
Another bug fix release distributed only to customers.

<h3><a name="V3.37_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- Some documentation about parameter lists was incorrect.
(gsparam.h)
	- The documentation did not note that one cannot "pipe" PDF files
into the interpreter.  (use.doc)

Adds documentation for the BJC-600 to devices.doc.  (devices.doc)

</pre><h3><a name="V3.37_Procedures"></a>Procedures</h3><pre>

Changes the debugging switch for OS calls from -Z0 to -Ze, and adds -Z0 for
high-level GC tracing.  (use.doc, gp_unifs.c, ialloc.c, igc.c)

</pre><h3><a name="V3.37_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- The ps2ascii shell script included an erroneous @d.  (ps2ascii)

Enhances ps2ascii to output color and rectangle fill/stroke information if
COMPLEX is defined.  (ps2ascii.ps)

</pre><h3><a name="V3.37_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- the BJC-600 driver didn't handle BitsPerPixel correctly.
(gdevcdj.c)

</pre><h3><a name="V3.37_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Some buggy Type 1 fonts confused the Type 1 font reader.
(gs_fonts.ps, gs_type1.ps, pdf_font.ps)

</pre><h3><a name="V3.37_Interpreter_PostScript"></a>Interpreter (PostScript)</h3><pre>

Fixes bugs:
	- .registerencoding didn't accept mixedarrays, which could cause an
error if an encoding was loaded long after initialization.  (zfont2.c)
	- If a program did a lot of saves and restores, the garbage
collector could get invoked much too often.  (iastate.h, ialloc.c, igc.c,
isave.c)

Changes the name of the rectappend operator to .rectappend, since it isn't a
standard PostScript operator.  (zdps1.c)

</pre><h3><a name="V3.37_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- PDF files didn't interact properly with ps2ascii.  (gs_pdf.ps)
	- setdash wouldn't accept a packed array.  (zgstate.c)
	- PDF files with incorrect generation numbers in object references
produced an error rather than a warning.  (pdf_base.ps)

</pre>

<h2><a name="Version3.36"></a>Version 3.36 (limited) (5/4/95)</h2>

<p>
This is a limited-distribution release for distributing bug fixes to a few
customers.

<h3><a name="V3.36_Documentation"></a>Documentation</h3><pre>
Adds some environment variables to the man page.  (gs.1)

</pre><h3><a name="V3.36_Procedures"></a>Procedures</h3><pre>

Adds the psmono device to all 32-bit configurations.  (*.mak)

Moves the psmono and 'bit' devices to DEVICE_DEVS12 to avoid exceeding the
120-character maximum length of the DOS command line.  (*.mak)

</pre><h3><a name="V3.36_Drivers"></a>Drivers</h3><pre>

Changes the pgm[raw] and ppm[raw] drivers so they do *not* automatically
switch to pbm or pgm/ppm respectively if this is possible for the particular
page being rendered; adds pgnm[raw] and pnm[raw] drivers that *do* do this.
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE.  However, existing programs will
still work; they just won't produce the smallest and simplest possible
output.  (devs.mak, gdevpbm.c)

</pre><h3><a name="V3.36_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- A multi-level restore didn't free gstates allocated by
intermediate saves, causing some global VM to be lost until a garbage
collection.  (isave.h, isave.c, zvmem.c)

Speeds up restore by skipping the scan of the character cache if no new
names have been allocated since the save.  (zfont.c)

Extends the client API to allow for popping return values off the operand
stack.  (imain.h, gs.c, gsmain.c)

</pre><h3><a name="V3.36_Library"></a>Library</h3><pre>

Modifies the character oversampling algorithms to help prevent dropouts.
(gsbitops.c, gschar.c)

</pre>

<h2><a name="Version3.35"></a>Version 3.35 (internal) (5/2/95)</h2>

<p>
This is another internal "snapshot" version.

<h3><a name="V3.35_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- Some of the file names in the `man' page had gotten out of date.
(gs.1)
	- Two references to .PageCount hadn't been changed to PageCount.
(language.doc, devarch.doc)

</pre><h3><a name="V3.35_Procedures"></a>Procedures</h3><pre>

Puts writeppmfile back in the standard Unix and DV/X configurations, since
gsftopk uses it.  Also puts the PDF reader in all 32-bit configurations.
(*.mak)

Moves the BMP devices to DEVICE_DEVS11 to avoid exceeding the 120-character
maximum length of the DOS command line.  (bcwin.mak, bcwin32.mak, os2.mak)

</pre><h3><a name="V3.35_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- unix-lpr.sh didn't handle 32-bit devices.  (unix-lpr.sh)
	- unix-lpr.sh still used the name .PageCount rather than PageCount.
(unix-lpr.sh)
	- font2c gave an error when trying to write general procedures in
font dictionaries.  (font2c.ps)

Adds a pdf2dsc.ps utility for writing out fake DSC-compliant PostScript code
to invoke the PDF reader, for the benefit of viewer programs that aren't
PDF-aware.  (unix-end.mak, pdf2dsc.ps)

</pre><h3><a name="V3.35_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The TIFF drivers put out incorrect PageNumber values.
(gdevtfax.c)
	- Printer (and file output) devices got closed and reopened
unnecessarily when changing parameters.  (gdevprn.c)
	- Printer (and file output) devices didn't check for invalid formats
following a % in OutputFile.  (devs.mak, gdevprn.c)
	- 1-bit memory devices were not considered page devices, unlike all
other memory devices.  (gsdevice.c)
	- The black-and-white H-P printers didn't close the printer
properly, causing printing not to happen under MS Windows.  (gdevprn.c)
	- Some compilers didn't like initializing a const char * to NULL.
(gdevlbp8.c)

Changes the X Windows driver so that if Ghostview specifies a bounding box,
this also sets ImagingBBox.  (gdevxini.c)

At the request of a customer, adds 1-, 4-, 8-, 24-, and 32-bit-deep memory
devices that store bits in 32-bit units rather than byte units.  (gdevmem.h,
gxdevmem.h, gdevmem.c, gdevm1.c, gdevm2.c, gdevm4.c, gdevm8.c, gdevm16.c,
gdevm24.c, gdevm32.c)

Adds a new MS Windows printer driver, mswinpr2, that uses a DIB rather than
a DDB.  (gdevwpr2.c)

</pre><h3><a name="V3.35_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- A routine wouldn't compile because of a bug in the SGI C compiler.
(zcsindex.c)
	- Some declarations were inconsistent when compiling for segmented
environments.  (gscie.c)
	- A routine wouldn't compile because of a bug in the VAX C compiler.
(gscie.c)

Turns on compiler optimization for OS/2; adds PDF support and more devices
for Win32 and OS/2.  (bcwin.mak, bcwin32.mak, os2.mak)

</pre><h3><a name="V3.35_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Font loading used 'setglobal' without binding it, which caused
some EPS files to signal errors.  (gs_fonts.ps)
	- A zero-length string with offset = 0 in a binary object sequence
caused an error.  (iscanbin.c)

Adds a LOCALFONTS switch that causes Ghostscript to load Type 1 fonts into
the current VM, rather than global VM.  According to Adobe, this is what
Adobe printers (but not other interpreters, such as DPS and CPSI) do.
(gs_init.ps, gs_fonts.ps)

</pre><h3><a name="V3.35_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The 'note' page size command caused pages to be clipped
improperly.  (gs_statd.ps)

Adds "word" image devices.  (gs_init.ps, zdevice.c)

Starts converting the interpreter to use an explicit instance pointer.  This
is very fragmentary so far and not really supported.  (main.h, gs.c,
gsmain.c, iccinit.c)

</pre><h3><a name="V3.35_Library"></a>Library</h3><pre>

Adds "word" image devices.  (gsdevice.h, gsdevice.c)

Removes the requirement that ImagingBBox[0] and [1] be non-negative.  (The
Adobe specification requires this, but Ghostscript supports more general
initial CTMs than the Adobe spec.)  (gsdparam.c)

</pre>

<h2><a name="Version3.34"></a>Version 3.34 (internal) (4/18/95)</h2>

<p>
This is a "snapshot" version made for internal purposes.  It was never
released to anyone.

<h3><a name="V3.34_Documentation"></a>Documentation</h3><pre>
Updates commprod.doc to be fully consistent with the AGFPL.  (commprod.doc)

</pre><h3><a name="V3.34_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- tar_x was out of date.  (tar_x)
	- tar_gs assumed that if any PC executables were present, gs.exe
would exist.  (tar_gs)
	- jpeg.mak said the current IJG version was 5b, but the makefiles
actually referred to version 5a.  (jpeg.mak)
	- The build rule for the LIPS III driver was incorrect.  (devs.mak)
	- Some definitions in the makefiles occurred out of order.
(ansihead.mak, cc-head.mak, gcc-head.mak, unixhead.mak, unixtail.mak)
	- The build rule for dvx-gcc.mak was incorrect.  (unix-end.mak)

</pre><h3><a name="V3.34_Interpreter"></a>Interpreter</h3><pre>

Restructures the CIE caches to move much more of the computation from color
mapping time to cache loading time.  (zcie.c)

</pre><h3><a name="V3.34_Library"></a>Library</h3><pre>

Fixes bugs:
	- Color conversion of 12-bit images was very slightly inaccurate.
(gxfrac.h)

Changes the transfer function, black generation, and undercolor removal
caches so that they sample at 1024 points and don't interpolate, rather than
sampling at 256 points and interpolating.  This significantly improves the
speed of colored image rendering.  ****** LIMITED TO 256 POINTS BECAUSE OF
O-STACK SIZE LIMIT. ****** (gxfmap.h, gxcmap.c)

Restructures the CIE caches to move much more of the computation from color
mapping time to cache loading time.  (gscie.h, gscie.c)

</pre>

<h2><a name="Version3.33"></a>Version 3.33 (4/13/95)</h2>

<p>
A few more last-minute bug fixes.  This is, finally, the first public
release since 3.12.

<h3><a name="V3.33_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- There was a reference to "VAX with OSF/1", which doesn't exist,
and an incorrect reference to VAX with Ultrix.  (make.doc)
	- The Unix makefiles incorrectly stated that gsdatadir was only
relevant to `make install'.  (ansihead.mak, cc-head.mak, dgc-head.mak,
gcc-head.mak)
	- Notes that DV/X users should use the zip version of the JPEG
library.  (jpeg.mak)

</pre><h3><a name="V3.33_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- A command line had gotten too long for the MS-DOS shell.
(gs.mak)
	- The VMS DEC C script didn't explicitly select DEC C.
(vms-decc.mak)
	- The VMS MODULES.LIS omitted SPDIFF and ZFPDIFF.  (modules.lis)
	- The VMS script had an incorrect entry.  (vms.mak)
	- The `if' fix in 3.31 broke some Unix systems with different
implementations of sh.  (unix-end.mak)
	- The makefile definition of gscspace_h was out of order.  (gs.mak)
	- An extra ; got written in gconfig_.h on DV/X platforms.
(dvx-tail.mak)
	- '.' was incorrectly prepended to the library search list on DV/X
platforms.  (dgc-head.mak)
	- The build rules for unix*.mak didn't work on DV/X.  (unix-end.mak)

Adds a description of the -c quit switch to the help message.  (gs.c)

For the DV/X platform, changes /usr/include to /djgpp/include as the place
to look for header files.  I'm not sure this is always correct.
(dvx-tail.mak)

</pre><h3><a name="V3.33_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- ps2ascii would cause an error if given a font that didn't have an
'X' character.  (ps2ascii.ps)
	- ps2ascii didn't intercept the Level 2 string display operators.
(ps2ascii.ps)

</pre><h3><a name="V3.33_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The Stylus Color driver had an incorrect type name.  (gdevstc.c)

</pre><h3><a name="V3.33_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- -dBitsPerPixel= didn't work properly for MS Windows or OS/2 PM.
(gdevmswn.c, gdevpm.c)
	- The Win32 platform didn't compile properly.  (memory_.h)

</pre><h3><a name="V3.33_Fonts"></a>Fonts</h3><pre>

Improves the font substitution algorithm to take the face name into account
in more cases.  (gs_fonts.ps)

</pre><h3><a name="V3.33_Library"></a>Library</h3><pre>

Fixes bugs:
	- Unrotated black-and-white bitmaps with an inverted device X axis
were displaced in X.  (gsimage1.c)

</pre>

<h2><a name="Version3.32"></a>Version 3.32 (4/7/95)</h2>

<p>
More bug fixes.  This is still not a public release.

<h3><a name="V3.32_Documentation"></a>Documentation</h3><pre>
Further clarifies the "two-phase commit" algorithm for device put_params
procedures.  (drivers.doc, gsparam.h)

Adds a note about a compiler bug under Ultrix 4.4.  (make.doc)

</pre><h3><a name="V3.32_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- Some installation scripts could fail because some implementations
of sh take the status of an `if' condition as the status of the `if'
command.  (unix-end.mak)

Adds "maintainer-clean" as a synonym for "real-clean".  (gs.mak)

Adds a -dORIENT1 switch that defines orientation = 1 as portrait for
setpage[params].  (use.doc, gs_init.ps, gs_lev2.ps, gs_statd.ps)

</pre><h3><a name="V3.32_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- ps2ascii didn't redirect %stdout completely.  (ps2ascii.ps)
	- ps2ascii didn't preserve the local/global VM mode.  (ps2ascii.ps)
	- ps2ascii didn't handle fonts with an all-zero or missing bounding
box correctly.  (ps2ascii.ps)
	- viewpbm didn't scale the image properly.  (viewpbm.ps)

</pre><h3><a name="V3.32_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The CGM driver wrote out an incorrect color precision value.
(gdevcgm.c)
	- The SGI bitmap driver was named "sgi" rather than "sgirgb".
(gdevsgi.c)
	- The PCX driver didn't round up an odd line length for gray-scale
output.  (gdevpcx.c)
	- The PCX driver produced incorrect output for gray-scale or 4- or
8-bit color.  (gdevpcx.c)

</pre><h3><a name="V3.32_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS MODULES.LIS file had gotten out of sync with the Unix
makefiles (again).  (modules.lis)

</pre><h3><a name="V3.32_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Some compilers won't accept '\l', even in the false arm of a
preprocessor conditional.  (scanchar.h)
	- A procedure was declared with an incorrect argument type.
(zcsindex.c)
	- The scaled font cache didn't copy XUIDs properly.  (bfont.h,
zfont.c, zfont2.c)
	- status could return true even if the file was closed.  (zfile.c)

</pre><h3><a name="V3.32_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The LZW filters were factored improperly.  (modules.lis, gs.mak,
vms.mak, slzwx.h, slzwc.c, slzwd.c)

Changes the DCTDecode filter for compatibility with Adobe implementations:
	- Ignore bytes preceding the 0xff that marks the beginning of the
JPEG data.  (sdctd.c)
	- Set MAX_BLOCKS_IN_MCU to 64.  (jpeg.mak, gsjpglib.h)

</pre><h3><a name="V3.32_Library"></a>Library</h3><pre>

Fixes bugs:
	- The "two-phase commit" for device parameters wasn't fully
implemented.  (gsiodev.c)
	- Asking for a device color map before the device was opened could
cause a crash.  (gsdparam.c)
	- The scaled font cache didn't copy XUIDs properly.  (gxfont.h,
gsfont.c)
	- 90 or 270 degree rotated black-and-white bitmaps (including
bitmapped fonts such as downloaded TrueType fonts) with an inverted device Y
axis were displaced in Y.  (gsimage1.c)
	- On high-resolution devices, parts of regions filled with halftones
could fail to be painted.  (gxclist.c)

</pre>

<h2><a name="Version3.31"></a>Version 3.31 (4/2/95)</h2>

<p>
A few final bug fixes for the release.  Includes significant speed
improvements for CIE color, and a first draft of a low-level CGM driver.

<h3><a name="V3.31_Documentation"></a>Documentation</h3><pre>
Notes that the BJC600 driver also works for the BJC4000.  (devs.mak)

</pre><h3><a name="V3.31_Procedures"></a>Procedures</h3><pre>

At the suggestion of a user, changes the default protections for installed
files on Unix and DV/X systems from 775/664 to 755/644.  (*head.mak)

At the suggestion of a user, adds a -dNOCIE switch to substitute DeviceGray
and DeviceRGB color spaces for CIEBasedA and CIEBasedABC spaces
respectively.  (gs_init.ps, gs_lev2.ps)

</pre><h3><a name="V3.31_Utilities"></a>Utilities</h3><pre>

Changes gslp and its relatives to use ISOLatin1Encoding for output, and to
send almost all printout to stderr rather than stdout (for use as a filter
under Unix).  (gslp.ps)

</pre><h3><a name="V3.31_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The fax/TIFF driver no longer exported gdev_fax_print_page, which
the DigiFax driver needs.  (gdevtfax.c)
	- The color DeskJet drivers gave an error for BitsPerPixel=3.
(gdevcdj.c)
	- The "Windows printer" driver was setting its margins in points
rather than inches.  (gdevwprn.c)
	- The BJ10 and BJ200 drivers calculated vertical skip distances
wrong.  (gdevbj10.c)
	- The BJ10 and BJ200 drivers output two garbage bytes following the
initialization string.  (gdevbj10.c)

Adds a preliminary driver that produces low-level CGM output.  (gdevcgml.h,
gdevcgmx.h, gdevcgm.c, gdevcgml.c)

</pre><h3><a name="V3.31_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS files had gotten out of sync with the other makefiles
(again).  (modules.lis, vms.mak)
	- The MS Windows and OS/2-PM drivers hadn't been updated to handle
BitsPerPixel as a standard parameter.  (gdevmswn.c, gdevpm.c)

Removes the TIFF drivers from the Windows platform, and restores the BMP
drivers.  (bcwin.mak)

</pre><h3><a name="V3.31_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The CIE color mapping cache could produce anomalous results
for the default (all zero values) color if some of the mapping
functions were non-linear.  (zcie.c)
	- MultiMaster font substitution got confused if substituted
fonts had their FontName changed.  (gs_fonts.ps)
	- A procedure was declared as private inconsistently.  (zdevcal.c)
	- Some pointer relocation procedures didn't work correctly on
systems with sizeof(T *) &gt; sizeof(int).  (istack.c)
	- The freelist vector wasn't large enough to handle graphics state
objects on 64-bit systems, leading to severe memory sandbars.  (iastate.h)
	- The debugging messages from the allocator had gotten inconsistent
and hard to use.  (ialloc.c)
	- Mixing save/restore with allocation could cause the GC never to
get run.  (isave.c)

Speeds up the mapping of CIE colors.  (zcie.c)

Adds a .namestring operator for getting the string of a name without having
to copy it.  (zstring.c)

</pre><h3><a name="V3.31_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The IJG code needed a couple more flags set for IJG v6.
(gsjmorec.h)
	- Some pointer relocation procedures didn't work correctly on
systems with sizeof(T *) &gt; sizeof(int).  (stream.c)

</pre><h3><a name="V3.31_Library"></a>Library</h3><pre>

Fixes bugs:
	- The end-test for the fast case of monobit images was wrong,
leading to out-of-range memory accesses.  (gsimage1.c)
	- Monobit images rotated by 270 degrees displayed incorrectly.
(gsimage1.c)
	- If a Type 1 font used hint replacement, some parts of the outline
before the hint replacement ignored the old hints.  (gstype1.c)
	- Some compilers didn't accept a variable name that was the same as
a macro with parameters.  (gxht.c)
	- A procedure was declared as private inconsistently.  (gdevm1.c)
	- Some pointer relocation procedures didn't work correctly on
systems with sizeof(T *) &gt; sizeof(int).  (gdevmem.c, gsstate.c)
	- The test on FORCE_HINTS_TO_BIG_PIXELS was backwards.  This bug was
supposed to have been fixed in 3.30, but somehow the fix got lost.
(gstype1.c)
	- 90 degree rotated monobit images could drop some scan lines.
(gsimage*.c)

Speeds up the mapping of CIE colors.  (gscie.h, gxcmap.h, gscie.c, gxcmap.c)

Speeds up color images (non-interpolated, 1-8 bits per component) by adding
a cache for mapped color values.  (gximage.h, gsimage.c, gsimage1.c,
gsimage2.c)

Shrinks the band list file slightly by using only as many bytes as necessary
for writing out colors, rather than always using 4 bytes.  (gxclist.c,
gxclread.c)

</pre>

<h2><a name="Version3.30"></a>Version 3.30 (beta) (3/21/95)</h2>

<p>
More bug fixes.  The garbage collector and PDF interpreter finally appear to
work reliably.

<h3><a name="V3.30_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- language.doc had gotten out of date.  (language.doc)

</pre><h3><a name="V3.30_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- Changes in the handling of %stdout had broken ps2ascii.
(gs_dps1.ps, ps2ascii.ps)

Improves ps2ascii to skip empty strings and not output redundant font
changes.  (ps2ascii.ps)

</pre><h3><a name="V3.30_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The fax and TIFF drivers didn't free all their working storage.
(This bug was fixed in 3.27, and the fix somehow got lost.)  (gdevtfax.c)

Adds new drivers:
	- sgirgb, to produce SGI RGB raster files.  (gdevsgi.c)
	- tiffcrle, to produce output in TIFF "CCITT 1-dimensional Huffman
RLE" format (Group 3 fax with no EOLs). (gdevtfax.c)
	- tifflzw, to produce output in TIFF LZW format (using the existing
CCITTFaxEncode filter code). (gdevtfax.c)
	- tiffpack, to produce output in TIFF PackBits format. (gdevtfax.c)

</pre><h3><a name="V3.30_Interpreter_PostScript"></a>Interpreter (PostScript)</h3><pre>

Fixes bugs:
	- If the current screen was set with a halftone, setcolorscreen
wouldn't accept what currentcolorscreen returned.  (gs_dps1.ps)
	- debug_print_full_ref didn't print t_oparray objects correctly.
(idebug.c)
	- The internal data for a font could be allocated in a different VM
space from the font dictionary, causing dangling pointers.  (zfont2.c)
	- definefont became confused if a program failed to delete the FID
from a re-encoded font.  (This is questionable PostScript, but dvips does
it.)  (zfont2.c)
	- If a BuildChar procedure did a save before the setcachedevice and
a restore afterwards, the memory manager would attempt to free the cache
device after it had already been freed by the restore, leading to damaged
freelists.  (gschar.c)
	- setresolution (in statusdict) was ignored.  (gs_lev2.ps,
gs_statd.ps)
	- If a string containing a string containing a \ was passed to the
token operator, the \ was not recognized properly in a Level 2 environment.
(iscan.c)
	- A couple of default dictionary sizes had become too small.
(iinit.c)

Makes DOS EOF (control-Z, 0x1a) a self-delimiting token, like left bracket.
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE, but it should not have any adverse
effects.  (gs_init.ps, iscan.c, iscantab.c)

Distinguishes arch_small_memory from arch_ints_are_short, and adds a new
-Z. switch to force small-memory table sizes regardless of actual memory
size.  (dstack.h, idict.c, zpcolor.c, zvmem2.c)

</pre><h3><a name="V3.30_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- A page with no Contents caused an error.  (pdf_main.ps)
	- Executing a Form resource caused an error.  (pdf_draw.ps)
	- Outlines with open entries caused an error.  (pdf_main.ps)
	- Embedded Type 3 fonts caused an error.  (pdf_draw.ps, pdf_font.ps)
	- The Widths array of fonts was ignored.  (pdf_font.ps)

</pre><h3><a name="V3.30_Library"></a>Library</h3><pre>

Fixes bugs:
	- Freeing an entry in the pattern cache didn't clear the pointers to
the raster data, producing a dangling reference that confused the garbage
collector.  (gxpcmap.c)
	- The test on FORCE_HINTS_TO_BIG_PIXELS was backwards.  (gstype1.c)
	- The pattern cache bookkeeping was incorrect.  (gxpcmap.c)
	- Depending on the order in which pointers were relocated, the
garbage collector could incorrectly relocate pointers from the character
cache.  (gxfcache.h, gsfont.c, gxccache.c, gxccman.c)

Changes the fast case of black-and-white images so it aligns scaled images
with the device coordinate system, to improve performance.  (gsimage1.c)

Extends the coordinate transformation routines to handle absurdly large
translation values in the CTM as long as the final device device coordinates
are within fixed-point range.  (gxmatrix.h, gxpath.h, gschar.c, gscoord.c,
gsmatrix.c, gxhint2.c, gxpath2.c)

Distinguishes arch_small_memory from arch_ints_are_short, and adds a new
-Z. switch to force small-memory table sizes regardless of actual memory
size.  (gdevprn.h, gxpcolor.h, gzht.h, std.h, gsfont.c, gsht1.c, gspaint.c,
gsstate.c, gxcht.c, gxht.c, gxpcmap.c)

</pre>

<hr>

<h2><a name="Version3.29"></a>Version 3.29 (internal) (3/8/95)</h2>

<p>
Another bug-fix release.  This release processes all but 7 of the 500+ files
on the Adobe Acrobat Sampler CD-ROM without giving an error.  The garbage
collector finally appears to be stable.  This version was created for a
customer; it was not released to the general public or even to the beta test
list.

<h3><a name="V3.29_Documentation"></a>Documentation</h3><pre>
Documents the possible need to set LD_RUN_PATH on SVR4 platforms.
(make.doc)

Expands the description of the device life cycle, and of the constraints on
put_params procedures.  (drivers.doc)

Adds an explicit copyright notice to the Aladdin Ghostscript Free Public
License.  (PUBLIC)

Clarifies that the Win32s documentation also applies to Windows NT.
(make.doc)

</pre><h3><a name="V3.29_Procedures"></a>Procedures</h3><pre>

Removes the obsolete writeppmfile operator from the standard configurations.
(gs.mak)

Changes the Watcom makefiles to work properly with Watcom C/C++ 10.0.
(make.doc, msc.mak, watc.mak, watcwin.mak, wccommon.mak)

</pre><h3><a name="V3.29_Utilities"></a>Utilities</h3><pre>

Adds a wftopfa utility for converting the Wadalab fonts to usable Type 0 and
Type 1 form.  (wftopfa)

</pre><h3><a name="V3.29_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Entries added automatically by definefont (FontInfo, ExactSize)
could cause a font dictionary to become full.  (gs_fonts.ps, gs_type1.ps)
	- wrfont.ps couldn't deal with very long CharStrings.  (wrfont.ps)

Makes the name of the Fontmap file an easily editable parameter.
(gs_fonts.ps)

Adds a utility for converting the Wadalab font to usable Type 0 and Type 1
form.  (wrfont.ps, wftopfa.ps)

</pre><h3><a name="V3.29_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The top margin for printer (and fax) devices was computed
incorrectly, using the X resolution rather than the Y resolution.
(gdevprn.h)
	- Changing the page size or resolution of a printer device closed
and reopened the device unnecessarily.  (gdevprn.c)
	- Changing the page size of the X11 device didn't change the initial
matrix, so (0,0) didn't wind up in the lower left corner.  (gdevx.c)
	- The bit devices didn't allow changing the number of bits per
pixel.  (gdevbit.c)

Adds a settable .IsPageDevice boolean device parameter to the X Windows
driver.  The default value is true.  (gdevx.h, gdevx.c)

Changes the PPM driver so that it chooses between PBM/PGM/PPM on a
page-by-page basis, rather retaining the most general format ever required
by any page.  (gdevpbm.c)

</pre><h3><a name="V3.29_Interpreter_PostScript"></a>Interpreter (PostScript)</h3><pre>

Fixes bugs:
	- The current page device could be null, rather than an empty
dictionary.  (igstate.h, zchar.c, zdevice.c, zdevice2.c, zgstate.c)
	- The scanner didn't signal an error for names or strings that were
too long.  (iscan.c)
	- A missing header file upset the VAX compilers.  (ztype.c)
	- Some places expecting dictionary operands didn't check the type,
because they incorrectly assumed that the dict_check_read/write macro did
this.  (idict.h, zdevice2.c, zht2.c, zmisc2.c)
	- The definition of quit in systemdict wasn't disabled within
encapsulated jobs.  (gs_lev2.ps)
	- resetfile gave an error if the file was closed, rather than doing
nothing.  (zfileio.c)
	- The scanner attempted to free an uninitialized pointer if it
reached EOF after a / or //.  (iscan.c)
	- A restore in a different file than the corresponding save caused
an invalidrestore error.  (gs_init.ps)
	- The default value of EndOfData in RunLengthDecode streams was set
to false.  (zfilter.c)
	- .registerencoding didn't invoke the save machinery correctly,
leading to GC problems.  (zfont2.c)
	- The facility for overriding .printerror didn't work correctly.
(gs_init.ps)
	- gs_run_file_open wasn't public.  (gsmain.c)
	- The interpreter returned e_undefined for undefined error names,
rather than the error code.  (interp.c)
	- Allocation in system memory (specifically, adding a block to a
stack) couldn't trigger automatic garbage collection.  (interp.c, igc.c,
zvmem2.c)
	- A restore in a different invocation of gs_run_string than the
corresponding save would stop reading the string.  (files.h, gsmain.c,
iccinit.c, zfile.c)
	- The Type 1 rasterizer state included a pointer into the middle of
an object, confusing the garbage collector.  (zchar1.c, zfont1.c)
	- When the garbage collector deleted a name, it didn't zero out the
string pointer.  (iname.c)
	- On platforms where obj_align_mod &gt; 4, the memory manager could
access 1 beyond the end of its freelists.  (iastate.h)
	- makefont and scalefont didn't check the type of their font operand
soon enough.  (zfont.c)
	- restore didn't finalize the objects it freed.  (isave.c)
	- restore didn't free system VM.  (isave.c)
	- Freeing a ref array that occupied an entire chunk didn't free the
chunk.  (ialloc.c)

Adds a .runexec operator which implements the 'close if error' function of
run.  (zfile.c, zfileio.c)

Moves the obsolete writeppmfile operator into a separate file.  (zfileio.c,
zwppm.c)

Makes the statistics returned by the memory manager more accurate.
(ialloc.c, zvmem.c)

Adds a (read-only) %Calendar% IODevice.  (zdevcal.c)

Adds a "hook" in the character operators to allow external code to
intervene; this is needed for a customer.  (ichar.h, zchar.c, zchar2.c)

Makes control-D (0x04) a self-delimiting token, like left bracket.  THIS IS
A NON-BACKWARD-COMPATIBLE CHANGE, but it should not have any adverse
effects.  (scanchar.h, iscan.c, iscantab.c)

Changes the error stack printout so that it puts line breaks between items
iff the items are being printed with ==.  (gs_init.ps)

Uses finalization to close streams being freed.  (igc.c, zfile.c, ziodev.c)

</pre><h3><a name="V3.29_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- Embedded Type 1 fonts that invoked save and restore while being
read caused an error.  (pdf_font.ps)
	- Large files that referenced a non-alphabetic font for the first
time late in the file could cause an error.  (pdf_main.ps)

</pre><h3><a name="V3.29_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- SubFileDecode streams didn't copy partial matches of the EOD
string into their output.  (sfilter1.c)

Makes switching between read and write modes a stream procedure.  (stream.h,
sfile.c, sfileno.c, stream.c, zfileio.c)

Makes file streams close themselves when finalized.  (We can't do this for
other streams, because finalization procedures aren't allowed to free
storage explicitly.)  (stream.h, sfile.c, sfileno.c, stream.c)

</pre><h3><a name="V3.29_Library"></a>Library</h3><pre>

Fixes bugs:
	- The obsolete files gcdefs.h and gsfile.c were still included in
the fileset.
	- A number of places didn't deal with null patterns properly (p_tile
== 0).  (gxdcolor.h, gspcolor.c, gxpcmap.c)
	- The pattern tiling algorithm was numerically unstable, especially
if the X/YStep vectors were close to the axes.  (gxcolor2.h, gspcolor.c,
gxpcmap.c)
	- setdeviceparams checked the values of read-only byte array
parameters incorrectly.  (gsdparam.c)
	- The statistics macros in gxfill.c didn't use DO_NOTHING when
disabled.  (gxfill.c)
	- Changing the orientation of a device closed and reopened the
device unnecessarily.  (gsdparam.c)
	- ioerrors occurring when writing command lists weren't reported
properly.  (gxclist.h, gxclist.c)
	- Errors from device procedures weren't always propagated up to
clients.  (gsimage1.c, gsimage3.c, gxclip2.c, gxclist.c)
	- Overflowing the fixed-point translation values in the CTM caused a
floating point exception rather than a limitcheck.  (gxmatrix.h, gscoord.c)
	- charpath set the current point correctly, but didn't append a
moveto element to the path.  (This mostly affected Mathematica output.)
(gzpath.h)
	- Image devices mapped colors incorrectly.  (gdevmem.c, gdevm16.c)
	- On devices with color capability but fewer than 4 bits per pixel,
color halftones didn't work (and could cause an arithmetic exception).
(gxdither.c)
	- Black-on-white memory devices didn't map colors properly.
(gdevprn.h, gxdevice.h, gxdevmem.h, gdevmem.c, gdevm1.c, gsdevice.c)
	- Memory devices with a non-zero origin in their initial matrix
clipped the image improperly.  (gsdevice.c)
	- The Type 1 rasterizer state included a pointer into the middle of
an object, confusing the garbage collector.  (gstype1.h, gxfont1.h,
gxtype1.h, gstype1.c, gxhint2.c)
	- The band rasterizer could produce garbled output for images
(including characters) on 64-bit architectures.  (gxclread.c)
	- Bounding boxes (for pathbbox and setbbox) could be slightly
inaccurate.  (gsmatrix.c)
	- On 64-bit architectures, halftone tiles less than 16 bits wide
were handled incorrectly.  (gxclist.c)

Adds an .IsPageDevice boolean device parameter (normally read-only).
(gsdparam.c)

Removes the library code for implementing the obsolete writeppmfile
operator.  (gswppm.c)

Makes the default matrix (for initmatrix and defaultmatrix) a settable
parameter in the graphics state.  (gscoord.h, gzstate.h, gscoord.c,
gsdevice.c, gsdparam.c)

Makes the statistics returned by the memory manager more accurate.
(gsmemory.h)

Adds a compile-time flag to choose whether or not to force Type 1 hints to
"big pixel" boundaries when oversampling.  (gstype1.c)

Changes the .PageCount device parameter back to PageCount, because the
change broke some scripts.  (gsdparam.c)

Adds optimization for 90 degree rotated images with pure colors.
(gximage.h, gsimage.c, gsimage1.c)

Changes the band rasterizer so that replicated halftone tiles are written on
the band list in unreplicated form.  (gsbitops.h, gxcldev.h, gsbitops.c,
gxclist.c, gxclread.c, gxht.c)

Changes the .HWBitsPerPixel device parameter to BitsPerPixel.  (drivers.doc,
language.doc, gdevcdj.c, gdevstc.c, gsdparam.c)

</pre>

<h2><a name="Version3.28"></a>Version 3.28 (beta) (2/13/95)</h2>

<p>
Another bug-fix beta release.  The number of bugs being fixed in each of
these sub-releases does exceed the number of new bugs introduced, but the
latter number is discouragingly high.

<h3><a name="V3.28_Documentation"></a>Documentation</h3><pre>
Adds some information about handling VMS file attributes for files
transferred by FTP.  (use.doc)

</pre><h3><a name="V3.28_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- unix-gcc.mak said the static linkage switch for SunOS was -Bstatic
rather than -static.  (unix-gcc.mak)
	- Some dependency lists in gs.mak were out of date.  (gs.mak)

</pre><h3><a name="V3.28_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- markhint.ps didn't check for protected fonts.  (markhint.ps)

</pre><h3><a name="V3.28_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The cdj driver had a byte/char agreement problem.  (gdevcdj.c)
	- The cdj driver attempted to initialize a dynamic array.
(gdevcdj.c)

Removes the setting of InputAttributes and OutputAttributes from the H-P
drivers, since this causes more problems than it solves.  (gdevdjet.c)

</pre><h3><a name="V3.28_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- makeoperator assigned incorrect attributes to operators. (bug
introduced in 3.27) (opdef.h, iinit.c, iutil.c, zmisc.c)

</pre><h3><a name="V3.28_Library"></a>Library</h3><pre>

Fixes bugs:
	- gs_makeimagedevice didn't set the caller's pointer to the newly
created device.  (bug introduced in 3.27) (gsdevice.c)
	- There were still some mismatches between char * and byte * values.
(gsdparam.c)
	- The halftone replication algorithm could produce inappropriately
large replicated masks.  (gxht.c)
	- stroke usually did the wrong thing for degenerate (single-point)
subpaths.  (gxstroke.c)

</pre>

<h2><a name="Version3.27"></a>Version 3.27 (beta)(withdrawn) (2/8/95)</h2>

<p>
Yet another bug-fix beta release.  This release had so many serious problems
(the most serious being at least one changed file that the release tool
failed to include in the fileset) that it was withdrawn less than a day
after it was issued.

<h3><a name="V3.27_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The NEWS for 3.26 didn't mention the fact that the stdxxx stream
interface used by MS Windows, OS/2, and Macintosh implementations had
changed.  (NEWS)
	- The file public.doc wasn't distributed with the previous fileset.

Brings the NeXTSTEP documentation up to date for NeXTSTEP releases 3.2 and
subsequent.  (make.doc)

</pre><h3><a name="V3.27_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- Some dependency lists in gs.mak were out of date.  (gs.mak)
	- A 'fi;' was missing in the Unix install script.  (unix-end.mak)
	- There was no VMS build script for the PDF options.  (vms.mak)
	- The VMS script used CC_QUALI instead of CC_QUAL in several places.
(vms.mak)

</pre><h3><a name="V3.27_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- ps2epsi's usage prompt referred to "pstoepsi".  (ps2epsi)
	- ps2epsi set PATH and LOCALPATH unilaterally.  (ps2epsi)

Comments out the sample usage line at the end of viewjpeg.ps.  (viewjpeg.ps)

</pre><h3><a name="V3.27_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The fax and tiff drivers didn't free all of their working storage.
(gdevtfax.c)

Adds user-contributed drivers for the BJC 600 and ESC/P printers.
(devs.mak, gdevcdj.c)

</pre><h3><a name="V3.27_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- Some necessary casts of string parameters to (const byte *) were
omitted.  (gp_mswin.c, gp_os2.c)

Adds the psmono and bit* drivers, and removes the p*m drivers, in the OS/2,
32-bit MS-DOS, and 32-bit Windows configurations.  (bcwin32.mak, os2.mak,
watc.mak)

</pre><h3><a name="V3.27_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- The Fontmap for Ultrix had somehow become slightly incorrect.
(Fontmap.Ult)

Removes the font file names from the dependency lists in cfonts.mak.  This
makes cfonts.mak readily usable with any set of fonts, but it also means
that it will always run font2c, rather than being able to avoid this if the
.c file is up to date.  (cfonts.mak)

</pre><h3><a name="V3.27_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Some operators could fail if the stdxxx streams weren't currently
open.  (files.h, zfileio.c, ziodev.c)
	- setpagedevice didn't handle unrecognized keys properly.
(gs_setpd.ps)
	- The value returned for the HWColorMap device parameter was
allocated incorrectly, confusing the garbage collector.  (iparam.c)
	- Typing ahead at the &gt;&gt;showpage&lt;&lt; prompt no longer caused all
further pages to be processed without stopping.  (gs_init.ps)
	- Setting DEVICEWIDTHPOINTS or DEVICEHEIGHTPOINTS on the command
line caused a typecheck.  (gs_init.ps)
	- The garbage collector didn't handle halftone threshold arrays
properly.  (zht2.c)
	- setdefaulttimeouts caused an error on Level 2 systems.
(gs_lev2.ps)
	- cvi and cvr weren't equivalent to token followed by a type check.
(iscan.h, iscannum.h, iscan.c, iscannum.c, ztoken.c, ztype.c)
	- In Level 2 systems, image and colorimage didn't allow 12 bits per
sample.  (zpaint.c)
	- If debugging was enabled, the garbage collector printed spurious
error messages about the allocator objects not being in a chunk.  (ialloc.c)
	- restore didn't reset the count of operator procedures, so the
operator procedure table could fill up.  Fixing this required splitting the
op_array_table into a global table and a local table.  (opdef.h, iinit.c,
iutil.c, zmisc.c)
	- .forgetsave could leave a dangling pointer in the memory manager,
causing an access error.  (ialloc.c, isave.c)
	- Freed objects weren't always marked as freed, which could confuse
the memory validator.  (ialloc.c)
	- .forgetsave didn't mark inner chunk headers as free, leading to
access errors.  (isave.c)

Changes the representation of operator procedures so that they point
directly to their definition in the op_array_table.  (iref.h, opdef.h,
idebug.c, igc.c, igcref.c, interp.c, zmisc.c)

Removes .makeglobaloperator.  (zmisc.c)

Adds patches to discard some common garbage produced by H-P-oriented
applications and drivers.  (gs_init.ps)

Changes the &gt;&gt;showpage&lt;&lt; prompt so that if the input reaches EOF, the
interpreter still stops after the next &gt;&gt;showpage&lt;&lt;, rather than processing
all subsequent pages.  This is a consequence of the bug fix that
automatically reopens the stdxxx files.

Adds an optional dictionary parameter for the RunLengthEncode/Decode
filters, to allow specifying EndOfData.  The default is true.  (zfilter.c)

Adds ByteTranslateEncode/Decode filters.  (zfilter2.c)

</pre><h3><a name="V3.27_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The K &gt; 0 option of the CCITTFaxDecode filter switched back to 2-D
encoding if an output buffer boundary fell in the middle of a 1-D line, and
signalled an error if an input buffer boundary fell in the middle of an EOL.
(scfd.c)

Adds an EndOfData flag to the RunLengthEncode/Decode filters.  If true, RLE
generates 128 as EOD, and RLD recognizes it; if false, RLE does not mark
EOD, and RLD ignores 128.  (srlx.h, gxclist.c, gxclread.c, sfilter1.c)

Adds ByteTranslateEncode/Decode streams.  (sbtx.h, sfilter2.c)

</pre><h3><a name="V3.27_Library"></a>Library</h3><pre>

Fixes bugs:
	- There were some mismatches between char * and byte * values.
(gsdparam.c)
	- Failure to round a scaling coordinate caused one-for-one
black-and-white images to render slower than they should.  (gsimage.c)
	- Setting PageSize without setting HWResolution could cause an
invalid memory access.  (gsdparam.c)
	- The garbage collector didn't handle halftone threshold arrays
properly.  (gxht.h, gsht.c, gsht1.c)

</pre>

<h2><a name="Version3.26"></a>Version 3.26 (beta) (2/1/95)</h2>

<p>
Yet another bug-fix beta release, still not ready for public release.

<h3><a name="V3.26_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The description of device properties had gotten out of sync with
the code.  (language.doc)

Splits off documentation specific to the Aladdin (non-GNU) release into a
separate file.  (readme, public.doc, unix-end.mak)

Adds a pointer to a collection of other free fonts (including some Cyrillic
ones) available on the net.  (public.doc)

</pre><h3><a name="V3.26_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- On VMS systems with both VAX C and DEC C installed, the build script
used VAX C rather than DEC C.  (vms.mak)
	- zfdecode.c didn't have a build rule.  (gs.mak)
	- Several macros in the makefile were used before they were defined.
(gs.mak)
	- Several macros in the makefile were used without being defined.
(gs.mak)

Replaces the gssetdev, gssetmod, and gsaddmod scripts with more variants of
echogs.  (echogs.c, gs.mak)

</pre><h3><a name="V3.26_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- The ps2ascii shell script passed a -f flag to the shell, which not
all shells recognize.  (ps2ascii)

</pre><h3><a name="V3.26_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Due to a typo in an initialization string, the H-P printers didn't
reset the top margin to zero.  (gdevdjet.c)

Adds InputAttributes and OutputAttributes entries to the H-P drivers.  (This
should probably be generic to all printers.)  (gdevdjet.c)

Replaces the contributed Epson Stylus Color driver with a newer version.
(devices.doc, gdevstc.c)

</pre><h3><a name="V3.26_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- DEC C complained about 'abs' and 'exit' not being declared.  (x_.h)
	- gp_mswin.c and gp_os2.c wouldn't compile.  (gp_mswin.c, gp_os2.c,
ziodev.c)

</pre><h3><a name="V3.26_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The default CIE rendering dictionary gave everything a magenta tint.
(gs_lev2.ps)
	- Changing HWResolution and PageSize in the same call of
setpagedevice produced an incorrect HWSize.  (gsdparam.c)
	- .putdeviceparams didn't accept all the keys that .getdeviceparams
returned.  (gsdparam.c)
	- The default handler for interrupt and timeout errors didn't push a
current object (command) on the stack.  (gs_init.ps)
	- The garbage collector didn't handle strings larger than 64K
properly.  (iastate.h, ialloc.c, igcstr.c)

Adds media matching and Policy consultation to the implementation of
setpagedevice.  (gs_setpd.ps)

Adds a MaxGlobalVM system parameter.  (zmisc2.c)

</pre><h3><a name="V3.26_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The CCITTFaxEncode filter could access a byte beyond the end of
the allocated area.  (scfe.c)
	- The CCITTFaxDecode filter could get an ioerror if a buffer
boundary fell in exactly the wrong place.  (scfd.c)

</pre><h3><a name="V3.26_Library"></a>Library</h3><pre>

Fixes bugs:
	- The garbage collector didn't trace colored halftones properly.
(gzht.h)
	- The garbage collector didn't relocate the bitmap pointers in
halftone caches properly.  (gzht.h, gxht.c)

Adds the ability to transmit dictionaries through the param_list mechanism
(specifically, as device parameters).  This change is
non-backward-compatible only for implementors of parameter lists, which only
exist within the Ghostscript core.  (gsparam.h, iparam.h, iparam.c)

Removes the InitialMatrix device property.  (gsdparam.c)

</pre>

<h2><a name="Version3.25"></a>Version 3.25 (beta) (1/24/95)</h2>

<p>
Yet another bug-fix beta release.  There are still at least half a dozen
significant known bugs to be fixed before a public release.

<h3><a name="V3.25_Documentation"></a>Documentation</h3><pre>
Notes that on Unix systems, one should not edit 'makefile', but should edit
the individual subfile and run tar_cat.  THIS IS A NON-BACKWARD-COMPATIBLE
CHANGE.  (make.doc)

Adds information on the Macintosh implementation.  (readme)

</pre><h3><a name="V3.25_Procedures"></a>Procedures</h3><pre>
Fixes bugs:
	- make clean failed on Unix systems where rm -f requires at least one
file name.  (gs.mak)
	- math_.h was omitted from many dependency lists.  (gs.mak)

</pre><h3><a name="V3.25_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The X Windows and MS Windows draw-line routines couldn't possibly
produce sufficiently correct output (since the interface only provides integer
coordinates).  (gdevx.c, gdevwddb.c)

In response to patent-related actions by Unisys and CompuServe, removes the
GIF driver.  (*.mak)

Changes dci_std_color (and std_device_std_color_* and prn_device_std_*) so
that if the number of bits per pixel is 32, the device is defined as CMYK
rather than RGB.  (gxdevice.h)

Removes the tseng8 device, which is no longer useful.  (devs.mak, gdevsvga.c)

Adds pseudo-alpha support to the SVGA drivers, via the TextAlphaBits and
GraphicsAlphaBits device parameters.  (gdevsvga.h, gdevsvga.c)

Adds a user-contributed driver for the Epson Stylus Color printer.  (devs.mak,
gdevstc.c, devices.doc)

</pre><h3><a name="V3.25_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS build scripts had gotten out of sync (again).  (vms*.mak)

</pre><h3><a name="V3.25_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The emulator name array was incorrectly declared const in one place.
(gs.c)
	- A closed file could incorrectly appear to be 'eq' to another file
(open or closed).  (iutil.c)
	- If %stdin/%stdout/%stderr was ever closed, it couldn't be
reopened.  (gs_btokn.ps, gs_init.ps, files.h, zfile.c, zfileio.c, zfilter.c,
zfproc.c, ziodev.c)

Changes (almost) all the operator routines to 'static'.  (z*.c)

</pre><h3><a name="V3.25_Library"></a>Library</h3><pre>

Fixes bugs:
	- The raster value for replicated tiles in the halftone cache was
incorrect, causing unaligned memory accesses.  (gxht.c)
	- stroke and strokepath could produce slightly inaccurate output
(leading to slight visible anomalies) as a result of stroke adjustment.
(gxstroke.c)
	- Attempting to draw an arc with zero radius could cause a numeric
exception.  (gspath1.c)
	- Setting the Orientation of a device to null resulted in actually
setting it to a random value.  (gsdparam.c)
	- charpath, stringwidth, and cshow attempted to remap the current
color unnecessarily.  (gschar.c)

Adds the ability to trace calls on the sqrt function (and possibly other math
functions in the future.)  (math_.h, gsmisc.c)

Adds additional interrupt checks in the banding code.  (gxclist.c, gxclread.c)

</pre>

<h2><a name="Version3.24"></a>Version 3.24 (beta) (1/17/95)</h2>

<p>
This was supposed to be a public release, but too many bugs showed up in 3.23,
so this is another bug-fix beta release.  This is the first release with a
working PDF reader.

<h3><a name="V3.24_Documentation"></a>Documentation</h3><pre>
Notes that Solaris requires using installbsd instead of install.  (make.doc)

</pre><h3><a name="V3.24_Procedures"></a>Procedures</h3><pre>

Changes 'make mostlyclean' so that it doesn't delete the Ghostscript
executable (but deletes everything else that 'make clean' does).  (gs.mak)

Changes the link list generator so it eliminates duplicate library requests.
(genconf.c)

Factors the interpreter further so as to include less unnecessary PostScript
support in the PDF interpreter.  (gs.mak, zpath.c, zpath1.c)

Adds a printout of the available language interpreters to the -h message.
(genconf.c, gs.c, iinit.c, gs.mak)

</pre><h3><a name="V3.24_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The alternate X drivers used a cast in an initializer, causing a
compilation error on some platforms.  (gdevxalt.c)

Adds a driver for the LaserJet IIID, including duplex printing if specified by
the Duplex page device parameter.  (gdevdjet.c)

Adds Orientation to the bit device.  (gdevbit.c)

</pre><h3><a name="V3.24_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- There was an extraneous pfen-&gt; in the NT file system module, causing
a compilation error.  (gp_ntfs.c)
	- The DLL code referred to an obsolete symbol a_foreign.  (gsdll.c)
	- The VMS build scripts omitted the LaserJet 4 driver.  (vms-*.mak)
	- The VMS build scripts had several other minor errors.  (vms.mak)

</pre><h3><a name="V3.24_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Defining a font alias in global VM with a name that was a string in
local VM caused an error.  (gs_fonts.ps)
	- The font compiler referred to an obsolete symbol a_foreign.
(font2c.ps)

</pre><h3><a name="V3.24_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- There was an extraneous '#' before an extern declaration.
(gsmain.c)
	- The interpreter could (incorrectly) attempt to expand the e-stack.
(istack.h, interp.c, istack.c)
	- zfproc.c called memcpy but didn't include memory_.h.  (zfproc.c)
	- A garbage collection occurring within a 'save' would often smash
memory.  (igc.c)
	- If the last character returned by the procedure of a procedure-based
filter was \r, readline could get an endless loop.  (zfileio.c)
	- Saving a change to a ref member of a structure confused the garbage
collector.  (isave.h, isave.c, zdict.c)
	- The -Zu debugging printout could cause an access error under rare
circumstances.  (isave.c)
	- Save objects could get allocated in global VM, causing dangling
references.  (zvmem.c)
	- The vmsave object created by the interpreter for a save didn't get
freed properly if the memory manager created an invisible save level, which
could cause the next garbage collection to crash.  (zvmem.c)
	- 'run' always printed an error message, rather than letting the
top-level control loop do it.  (gs.c, gs_init.ps)

Adds support for duplex devices.  (gxdevice.h, gsdparam.c, gs_statd.ps,
gs_setpd.ps)

Adds the beginnings of support for CID-keyed fonts.  (gs_cidfn.ps)

Changes the format of the stack dump printed for errors, to make it easier to
read.  (gs_init.ps)

</pre><h3><a name="V3.24_Interpreter_PostScript"></a>Interpreter (PostScript)</h3><pre>

Fixes bugs:
	- The .local/global allocation operators always allocated in system
VM.  (zsysvm.c)
	- setpage[params] caused an error.  (gs_lev2.ps)
	- If an error occurred during a cshow or (x|y|xy)show, the interpreter
freed the enumerator twice.  (zchar.c, zchar2.c)

Changes setpageparams so that orientation = 0 means portrait.  This is not
compatible with AGFA's convention for roll-feed devices, but it is compatible
with the more common cut-sheet printers.  (gs_statd.ps)

Adds meaningful values for the Emulator resource.  (gsmain.c, gs_res.ps)

Makes -Z? validate the state of memory before and after save and restore.
(ialloc.h, igc.h, ialloc.c, igc.c, ilocate.c, zvmem.c)

</pre><h3><a name="V3.24_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- The Unix install script didn't install the PDF files if they were
present.  (unix-end.mak)
	- PDF to PostScript conversion didn't work at all.  (It still doesn't
work very well.)  (pdf_2ps.ps, pdf_main.ps)
	- Images with an Indexed color space and no Decode entry caused an
error.  (pdf_draw.ps)
	- The 'Page &lt;n&gt;' messages were printed even if QUIET was set.
(pdf_main.ps)

Changes the interpreter so that when it encounters an unknown operator, it
prints an error message and continues, rather than signalling an error.
(pdf_base.ps)

Makes F a synonym for f if there is nothing on the operand stack, to
compensate for a bug in some Adobe software.  (pdf_base.ps)

Changes pdfgetpage so it uses 1-origin rather than 0-origin indexing.  THIS IS
A NON-BACKWARD-COMPATIBLE CHANGE.  (pdf_main.ps)

</pre><h3><a name="V3.24_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The Group 3 2-D and Group 4 encoders produced incorrect output if a
scan line beginning with a black pixel was followed by a scan line beginning
with a white pixel.  (scfe.c)
	- A SubFileDecode filter with a count of 1 and a non-empty EOD string
would smash memory.  (sfilter1.c)

Updates the DCT filters so they will work with the latest version (5a) of the
IJG library.  (*.mak, jpeg.mak, sjpegerr.c)

</pre><h3><a name="V3.24_Library"></a>Library</h3><pre>

Fixes bugs:
	- A call with integer parameters to a procedure with floating point
arguments didn't work on non-ANSI compilers.  (gsimage.c)
	- Arcs could get turned into polygons if the scaling values in the CTM
were very large and the radius was (in user space coordinates) very small.
(gspath.c)
	- The current point was defined when a BuildChar procedure was called.
(This bug was documented as fixed in version 2.2!)  (gschar.c)

Adds support for Orientation and Duplex page device parameters, for those
devices that support these.  (gdevprn.h, gxdevice.h, gsdevice.c, gsdparam.c)

</pre>

<h2><a name="Version3.23"></a>Version 3.23 (beta) (1/5/95)</h2>

<p>
This is almost entirely a bug fix release.  It also includes a largely working
PDF reader.  This is intended as the beta test release for the next public
release.

<h3><a name="V3.23_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- COPYLEFT, COPYING, NEWS, PUBLIC, README, and the standard Fontmap
were omitted from the 3.22 fileset.

Documents the use of the -oldc switch to work around a compiler crash on
the DECstation.

Expands and clarifies the documentation for building the DesqView/X version
with djgcc.  (make.doc)

Adds documentation on the "600x300" H-P inkjet printers, explaining why
this alleged higher resolution is not available.  (devices.doc)

Adds to the PUBLIC license a warning that it is not a GNU License, and a
requirement to include a copy of or a pointer to the License in any written
material.  (PUBLIC)

Documents the fact that Ghostscript *does* attempt to look up files in the
current directory first.  (use.doc)

</pre><h3><a name="V3.23_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- In VMS.MAK, .JPEG should have been changed to .JPEG-5 in a few
places.  (vms.mak)

Adds the pjxl300 driver to all configurations that include the other color
DeskJet drivers.  Replaces pjet and pjetxl with pj and pjxl.  (*.mak)

Makes 'run' recognize PDF files if the PDF reader is included.
(pdf_main.ps)

</pre><h3><a name="V3.23_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- viewjpeg.ps needed the test for languagelevel = 2 at the
beginning of the file.  (viewjpeg.ps)
	- prfont.ps used 'min', which isn't a standard PostScript operator.
(prfont.ps)
	- prfont.ps created Encoding vectors that weren't 256 elements
long.  (prfont.ps)

Adds the gsdj500 script to the installation list.  (unix-end.mak)

Changes the Unix "line printer" shell scripts to add the date to the page
header.  (gsbj, gsdj, gsdj500, gslj)

Changes ansi2knr so that it will work properly on systems where the ctype
macros don't handle 8-bit characters correctly.  (ansi2knr.c)

</pre><h3><a name="V3.23_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Some compilers don't allow casts in initialization expressions.
(gdevx.c, gdevxalt.c)
	- The cdj drivers didn't initialize the color_info structure
properly.  (gdevcdj.c)

Adds another alternate X Windows driver, x11mono, that is a black-and-white
device.  (devs.mak, gdevxalt.c)

Adds a user-contributed driver for the Apple Imagewriter LQ.  (devs.mak,
gdevadmp.c)

</pre><h3><a name="V3.23_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS MODULES.LIS file had gotten out of sync with the makefile
(again); GDEVABUF and GSBITOPS were missing.  (modules.lis)
	- The VMS script file had gotten out of sync with the makefile
(again).  (vms.mak)
	- The MS Windows platform code didn't recognize Windows 95 (Windows
4.0) as equivalent to Windows NT.  (gp_mswin.c)
	- File name enumeration didn't work on OS/2 or win32.  (gp_ntfs.c,
gp_os2.c)
	- -sOutputFile= didn't work under MS Windows.  (gp_mswin.c)

Changes the SCO Unix direct frame buffer driver so it generates in-line
instructions to access the frame buffer, for a dramatic speed improvement.
(gdevpcfb.h, gdevsco.c)

</pre><h3><a name="V3.23_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- If a font couldn't be found in the Fontmap, a recursion loop
sometimes occurred.  (gs_fonts.ps)
	- Aliases for global fonts weren't automatically created as global,
possibly leading to a recursion loop.  (gs_dps1.ps, gs_fonts.ps)
	- If a font was loaded into global VM within an inner save, the restore
deleted it from FontDirectory but not from SharedFontDirectory, causing a
possible recursion loop.  (gs_dps1.ps, gs_fonts.ps, idict.h, idict.c, zdict.c)

Further improves the algorithm for substituting for unknown fonts.
(gs_fonts.ps)

</pre><h3><a name="V3.23_Interpreter_PostScript"></a>Interpreter (PostScript)</h3><pre>

Fixes bugs:
	- zcontrol.c had an assignment of const char * to const byte *,
which some compilers don't like.  (zcontrol.c)
	- Setting an Indexed color space based on a CIE space caused an
attempt to free a random block of memory.  (zcsindex.c)
	- Some compilers don't like mixing conditionals and casts in
initialization expressions.  (iref.h)
	- Some calculations of table sizes for string garbage collection
didn't work if sizeof(long) != 4, leading to smashed strings.  (iastate.h,
ialloc.c, igcstr.c)
	- Strings longer than about 7000 bytes smashed their chunk header
and confused the garbage collector.  (ialloc.c)
	- Some compilers needed iccfont.c to include strimpl.h.
(iccfont.c)
	- The obsolete file zcspace2.c was still included in the fileset.
	- If the command line included any @-files that required searching
the library path, a limitcheck would occur.  (zfile.c)
	- The insideness testing operators caused a memory access error,
because the procedure vector hadn't been updated to provide a default
get_alpha_bits procedure.  (zupath.c)
	- gcheck didn't check for stack underflow.  (zvmem2.c)
	- cleardictstack could fail to clear the dictionary stack if the
stack had overflowed into additional blocks.  (zdict.c)
	- If the '-' switch was selected, resources weren't released
properly on exit.  (gs.c)
	- Setting a Pattern color space based on a CIE space caused an
invalid memory access.  (zcsindex.c)
	- The garbage collector didn't treat refs properly on machines with
short ints.  (igcref.c)
	- Operators with more than 16 arguments could break the
interpreter.  (interp.h, iinit.c, interp.c)
	- save/restore didn't restore the setting of the current allocator
VM (local/global).  (isstate.h, isave.c)
	- stdpre.h declared exit as an extern, instead of letting gsmain.c
declare it.  (stdpre.h, gsmain.c)
	- gs.c used fputs to print help messages rather than fprintf.
(gs.c)
	- Interrupts failed to re-execute the operation that was
interrupted.  (interp.c)
	- Low-resolution CMYK devices didn't use separate screens for each
color plane as the default.  (gs_init.ps)
	- filterdict wasn't getting undef'ed at the end of initialization.
(gs_init.ps)
	- gstate operations were broken (bug introduced in 3.02).
(zdevice2.c)
	- resourceforall didn't remove the resource dictionary from the
dictionary stack when calling the client-supplied procedure.  (gs_res.ps)
	- currentcolor with an Indexed color space returned a real rather
than an integer.  (zcolor2.c)
	- setshared / setglobal left the stack in an unobvious state if
they were given a non-Boolean argument.  (gs_dps1.ps)
	- sethalftone followed by currenthalftone returned an invalid value.
(zht2.c)
	- Empty strings produced spurious garbage collector error messages.
(gsstruct.h, scommon.h, igc.c, igcstr.c, iname.c)
	- The garbage collector didn't trace Separation color spaces properly.
(gscsepr.c)

Changes defineresource so that it does not, by default, make instances
read-only.  (gs_res.ps)

Adds .{local,global}{array,dict,packedarray,string} operators for creating
objects in a specific VM space.  (zsysvm.c, gs_dps1.ps)

Adds definitions of setpage and setpageparams to statusdict.  (gs_setpd.ps,
gs_statd.ps)

Alleviates some performance problems in the garbage collector.  (igc.c)

</pre><h3><a name="V3.23_Interpreter_PDF"></a>Interpreter (PDF)</h3><pre>

Fixes bugs:
	- PDF files that used filters with parameters caused a typecheck
error because the arguments to 'filter' were reversed.  (pdf_base.ps)
	- The (undocumented) PDF 1.1 ability to specify link and annotation
destinations indirectly was not supported.  (pdf_main.ps)
	- The (undocumented) PDF ability to specify a null page in a link
destination was not supported.  (pdf_main.ps)
	- The PDF encodings weren't loaded properly in a system with both
PS Level 2 and PDF features.  (gs_res.ps, gs_init.ps)
	- If the next line after a stream keyword was blank, the line
wasn't skipped, which matters for binary data.  (pdf_base.ps)
	- A Q operator with no matching q operator caused an error.
(pdf_draw.ps)
	- The text position wasn't preserved across a fill or stroke
operator.  (gs_pdf.ps, pdf_draw.ps)
	- Embedded Type 3 fonts didn't work.  (pdf_base.ps, pdf_draw.ps,
pdf_main.ps)
	- Masked images with no Decode value had their polarity inverted.
(pdf_draw.ps)
	- Embedded Type 1 fonts referenced from within a stream didn't
work.  (pdf_font.ps)

Changes the PDF code so that it automatically recognizes PDF files as such.
(pdf_main.ps)

Splits out the PixelDifference filters as a separate "feature".  (gs.mak)

</pre><h3><a name="V3.23_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- Closing the primary input stream caused an invalid memory access.
(stream.c)
	- Increasing the size of a buffer within a save resulted in a
dangling reference after the restore.  (files.h, sfilter.h, zfile.c,
zfilter.c)
	- The garbage collector didn't properly trace streams that referenced
strings directly.  (stream.h, stream.c, ziodev.c)

</pre><h3><a name="V3.23_Library"></a>Library</h3><pre>

Fixes bugs:
	- An extraneous \ upset some compilers.  (gdevabuf.c)
	- Uncolored Patterns that completely filled their bounding box
caused an invalid memory access.  (gspcolor.c)
	- If a color image required clipping, black or white pixels might
be rendered with incorrect (random) colors.  (gxcpath.c)
	- Reference counts for color spaces were sometimes set too high, so
they would only be freed by restore or garbage collection.  (gscolor.c)
	- The character cache could get confused if the Encoding for the
character wasn't a name.  (gschar.c)
	- Character outlines were always rendered with flatness = 0,
causing very bad performance for large characters.  (gzstate.h, gschar.c,
gsimage.c, gxfill.c, gxstroke.c)
	- If a device (presumably uninitialized) had a
color_info.num_components of zero, an invalid memory access could occur.
(gsdparam.c)
	- Intersecting clipping paths that are not both rectangular didn't
properly set the outer box of new clipping path, leading to unnecessary
computation.  (gxcpath.h, gxacpath.c, gxcpath.c)
	- A call passed false instead of NULL.  (gschar.c)
	- On machines where sizeof returns a long, genarch.c failed.
(genarch.c)
	- xfonts were consulted, incorrectly, even for stroked characters.
(gxccman.c)
	- gstate/currentgstate/setgstate didn't work properly.  (gsline.c,
gsstate.c)
	- On CMYK devices needing halftoning, colors with C = M = Y were
always converted to gray shades.  (gxcmap.c)
	- Isolated horizontal lines, or the horizontal edges of rectangles,
could get drawn with one or both end pixels missing.  (gxfill.c)

Changes the character cache back so it oversamples characters at small
sizes.  (gschar.c)

Changes all occurrences of (void)x to discard(x), and defines discard in
stdpre.h as a cast to void, to make it possible to pacify compilers that
don't accept this construct for some kinds of x.  (gpcheck.h, stdpre.h,
store.h, gdevmswn.c, gp_mswin.c, gscoord.c, gxclread.c, igc.c, sfile.c,
sfileno.c, zcie.c, zht2.c, ziodev.c, zmisc1.c)

Increases the size of the halftone cache on large-memory machines from 35K
to 100K.  This substantially improves halftoning performance at higher
resolutions.  (gxht.c)

</pre>

<h2><a name="Version3.22"></a>Version 3.22 (beta) (11/30/94)</h2>

<p>
This is primarily a bug fix release.  It also includes limited anti-aliased
graphics capability.  This release was not distributed to the public.

<h3><a name="V3.22_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The definition of ghost_h was misplaced, so changes in it or its
antecedents didn't force recompilation of its dependents.  (gs.mak)

Actually implements the -Z+ switch, for forcing small stack blocks.
(interp.c)

Makes the -dSAFER switch disable the %pipe syntax for file names, even for
reading.  (gs_init.ps)

</pre><h3><a name="V3.22_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The dfax drivers incorrectly set EncodedByteAlign to false.
(gdevdfax.c)
	- softwareValue and dateTimeValue were declared as byte rather than
char.  (gdevtfax.c)

</pre><h3><a name="V3.22_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS DEC C compilers declare delete in unixio.h, and doesn't
declare unlink anywhere.  (stdio_.h)
	- The VMS compilers declare malloc and free in stdlib.h, which
wasn't being included in malloc_.h.  (malloc_.h)
	- The SCO Unix C compiler needs both &lt;sys/time.h&gt; and &lt;time.h&gt;.
(time_.h)
	- The VMS compilers declare abs in stdlib.h, which wasn't being
included anywhere.  (gshtscr.c)
	- The definition for A4 paper in VMS-AXP.MAK was incorrect.
(vms-axp.mak)

Renames VMS-AXP.MAK as VMS-DECC.MAK, with some changes that make it
appropriate for DEC C on both VAX and AXP platforms.  (vms-axp.mak =&gt;
vms.decc.mak)

</pre><h3><a name="V3.22_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- gs_kanji.ps got an invalidaccess error.  (gs_kanji.ps)

</pre><h3><a name="V3.22_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- An off-by-1 test in the roll operator caused it to smash the
stack if the operand stack had overflowed into additional blocks.
(zstack.c)
	- The default CIE color rendering dictionary didn't assume a
reasonable intermediate (XYZ) space.  (gs_lev2.ps)
	- CIE color mapping tables weren't traced properly by the garbage
collector.  (gscie.h, gscie.c, zcie.c)
	- If the very last character of a file was a ^M, the scanner
(incorrectly) signaled a syntaxerror.  (iscan.c)
	- If an operator could return both a typecheck and a
stackunderflow, it always returned a stackunderflow, which doesn't match
the behavior of Adobe interpreters.  (opcheck.h, idparam.c, interp.c,
iutil.c, z*.c)
	- astore, dictstack, and execstack could return a spurious
invalidaccess error (or fail to detect an invalid access) if the operand
stack had overflowed into additional blocks.  (istack.c)
	- The garbage collector didn't relocate pointers to names!  (Bug
introduced in 3.20.)  (iname.h)
	- If the dictionary stack overflowed into additional blocks, the
cached value pointer for a name could get set incorrectly, and also not get
relocated by the garbage collector.  (idict.c)
	- If the dictionary stack overflowed into additional blocks, the
post-GC fixup of cached value pointers in names could cause an addressing
error.  (igc.c)
	- With the -Z? switch set, the garbage collector could incorrectly
report that objects or strings weren't in any chunk.  (igc.c)
	- &lt;&lt; /a 1 /a 2 &gt;&gt; /a get gave the value 2 rather than 1.
(gs_init.ps)
	- Numbers in binary object sequences and encoded number arrays
didn't work properly on machines where sizeof(short) != 2 or sizeof(long)
!= 4.  (ibnum.c)
	- The put operator for dictionaries allowed null as a key.
(idict.h, idict.c)
	- &gt;&gt; didn't give an error if there were an odd number of values on
the stack above the next mark.  (gs_init.ps)
	- Operations that explicitly freed ref objects (setting a CIE
colorspace, resizing a dictionary, popping a block off a stack) could
corrupt storage.  (ialloc.c)
	- The -Z@ switch, which fills freed blocks with a recognizable bit
pattern, could incorrectly overwrite freed blocks in previous save levels,
causing invalid memory accesses.  (ialloc.c)
	- Since streams freed by a restore weren't marked as free, they
could confuse the garbage collector and lead to invalid memory accesses.
(zfile.c)
	- If one of the built-in dictionaries overflowed during
initialization, no error was reported -- entries were simply discarded.
(iinit.c)
	- If the level2.dev feature was combined with certain other
features, the current languagelevel was 2 when some gs_*.ps files were
loaded, causing them to load incorrectly.  (gs_btokn.ps, gs_setpd.ps)
	- If readline read a line that ended with only a CR (no LF)
followed by an end-of-file, it incorrectly closed the stream.  (zfileio.c)

Adds a .cond operator, similar to the Lisp multi-arm conditional.
(zcontrol.c)

Adds a .makeglobaloperator operator, allowing the definition of operator
procedures in local VM that turn into global operators, provided the save
level is zero.  (iref.h, opdef.h, iinit.c, interp.c, zmisc.c)

Note: the fix for returning typecheck vs. stackunderflow requires that all
operators (or other code) that uses return_error(e_typecheck) to indicate
an incorrect object type on the operand stack must change this to
return_op_typecheck(op), where op points to the operand.  THIS IS A
NON-BACKWARD-COMPATIBLE CHANGE.

Implements string array and name array parameters for parameter lists.
(gsparam.h, iparam.c)

Brings filterdict inside the INITIAL_DICTIONARIES conditional.  (iinit.c)

Adds a .currentscreenlevels operator that returns the number of
distinguishable halftone levels.  (zht.c)

</pre><h3><a name="V3.22_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The 2-D case of CCITTFaxDecode could get confused by an input
data buffer boundary that fell immediately after a horizontal code.
(scfd.c)
	- The LZW decoder didn't detect invalid data unless DEBUG was
selected at build time.  (slzwd.c)

</pre><h3><a name="V3.22_Library"></a>Library</h3><pre>

Fixes bugs:
	- The clipping region accumulator could refer to a clipping
rectangle even after it had been freed.  (No effect on execution unless the
-Z@ switch was selected.)  (gxacpath.c)
	- setbbox expanded the bounding box, but didn't place a limit on
further path elements, if the current path wasn't empty.  (gsdps1.c)
	- setbbox didn't make sufficient allowance for rounding.
(gsdps1.c)

Implements the ProcessColorModel parameter (read-only) for all devices.
(gsdparam.c)

Adds a gs_currentscreenlevels procedure that returns the number of
distinguishable halftone levels.  (gsht.c)

</pre>

<h2><a name="Version3.21"></a>Version 3.21 (beta) (11/17/94)</h2>

<p>
This is primarily a bug fix release.  It also includes a substantial
improvement in the Type 1 font hinting algorithms.  This release was not
distributed to the public.

<h3><a name="V3.21_Documentation"></a>Documentation</h3><pre>
Fixes bugs:
	- The `man' page referred to gnu.ghostscript.bug rather than
comp.lang.postscript.  (gs.1)

Documents the special entries in operator definition tables that allow
switching dictionaries.  (opdef.h)

</pre><h3><a name="V3.21_Procedures"></a>Procedures</h3><pre>

Moves the definition of JSRCDIR to the individual platform makefiles, to
make it easier to change on platforms that don't have file links.  (*.mak)

</pre><h3><a name="V3.21_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- ansi2knr didn't recognize that a line ending with } couldn't be a
function definition.  (ansi2knr.c)
	- ps2epsi always returned an empty bounding box.  (ps2epsi,
ps2epsi.bat)

</pre><h3><a name="V3.21_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The bitrgb device had an invalid depth of 3.  (gdevbit.c)

Replaces the color mapping code in the X driver with a much faster
algorithm, courtesy of Tim Theisen.  (gdevx.h, gdevx.c, gdevxini.c)

</pre><h3><a name="V3.21_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- Two variable names were misspelled.  (gdevpm.c, gp_mswin.c)
	- It wasn't possible to compile a non-DLL configuration under OS/2.
(os2.mak)
	- Compilation under Microsoft C/C++ 8.0 gave errors.  (gp_mswin.h,
gp_mswin.c, gshtscr.c)

Adds some more devices to the OS/2 makefile.  (os2.mak)

</pre><h3><a name="V3.21_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- wrfont.ps, and hence bdftops, didn't write out the FontType or
PaintType.  (Bug introduced since 2.6.1)  (wrfont.ps)
	- wrfont.ps omitted a 'begin' and 'end', causing -! or -| to be
undefined when the font was loaded.  (Bug introduced since 2.6.1)
(wrfont.ps)

</pre><h3><a name="V3.21_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- make_tasv_old called make_tasv_new with extra arguments.
(store.h)
	- currentcacheparams only returned 2 values instead of 3.
(zfont.c)
	- ustroke popped one element too many off the stack if a matrix was
supplied.  (zupath.c)
	- inu[eo]fill popped one element too many off the stack.
(zupath.c)
	- The color rendering dictionary was initialized to null rather
than a valid dictionary.  (gs_lev2.ps)
	- An invalid IODevice resource named "9" got created.  (gs_res.ps)
	- bytesavailable often caused an error rather than returning -1.
(zfileio.c, stream.c)
	- The insideness testing operators always returned true if the
aperture was defined by a user path rather than a point.  (zupath.c)
	- If INITIAL_DICTIONARIES was defined in the makefile, the
definition of the initial_dictionaries array was missing a comma.
(iinit.c)
	- Even if userdict appeared in INITIAL_DICTIONARIES, gs_init.ps set
its maxlength to 200.  (gs_init.ps)
	- Setting a CIE color space left a garbage value on the stack.
(zcie.c)
	- If a file or filter was opened and then closed, opening a file
subsequently within a 'save' could lead to a memory access error in the
garbage collector.  (zfile.c)
	- Setting an Indexed or Separation color space could cause a crash
either in the garbage collector or when printing out the e-stack.
(icsmap.h, zcsindex.c, zcssepr.c)
	- Invoking a filter with an invalid data source or sink could cause
a memory access error (bug introduced in 3.20).  (zfilter.c)
	- Invoking stringwidth on a font whose BuildChar procedure did a
save could cause a memory manager error or infinite loop, because
stringwidth attempted to use an inapplicable shortcut.  (gschar.c)
	- The bounding box for rendering stroked Type 1 characters didn't
take square caps and miter joins into account.  (gs_type1.ps)
	- Invoking filter with DCTDecode or DCTEncode could cause an
addressing error if no dictionary argument was supplied.  (zfdctd.c,
zfdcte.c)
	- The Generic resource, the Font resource, and half a dozen
resources with no predefined instances all shared the same Instances
dictionary.  (gs_res.ps)
	- The temporary null device allocated for stringwidth was never
freed.  (gschar.h, gschar.c, zchar.c)
	- Internal operators, and structures that might be freed on stack
unwinding, could "escape" from the e-stack.  (zcontrol.c, ztype.c)
	- makefont and scalefont didn't properly handle a font whose
Encoding had been changed.  (bfont.h, zfont.c, zfont2.c)
	- Type 1 fonts with PaintType = 2 incorrectly checked for an xfont.
(gxfont.h, gschar.c, gsfont.c, zchar1.c, zfont1.c, zfont2.c)
	- Specifying a string argument with -d...=(...) or -d...=&lt;...&gt;
would cause an invalidaccess error.  (gs.c)
	- The environment for encapsulated jobs didn't rebind quit to stop
in userdict.  (gs_lev2.ps)
	- restore didn't deal properly with open files on the e-stack.
(zvmem.c)
	- Even with the '-' switch, Ghostscript would try to read ahead in
the input stream rather than processing input character-by-character.
(ziodev.c)
	- If an error occurred with a unreadable dictionary on any stack,
the standard error printer would get into an error loop and exit the
interpreter.  (gs_init.ps)
	- The for_roots macro in igc.c used ap rather than mem as its
second formal parameter.  (This typo had no effect on the executable
program.)  (igc.c)
	- If saving the stacks for an error caused a GC request, a value
could get stored into an improper variable on the C stack, causing havoc.
(interp.c)
	- setdash checked to make sure that the distance array had read
access; Adobe interpreters don't check this.  (zgstate.c)
	- The roots for gs_run_string and gs_interpret weren't registered
properly, which could cause a dangling reference in the case of a restore
whose save had been done earlier.  (gsmain.c, interp.c)

Adds an OpenOutputFile Boolean device parameter for printer devices; if
true, the device opens the OutputFile at the time the device is opened,
instead of waiting for the first showpage.  This helps with synchronization
when the OutputFile is a pipe.  (gdevprn.h, gdevprn.c)

Changes the BEGIN/END_OP_DEFS macros to require an explicit { and } at each
use.  (gsmain.c, interp.c, z*.c)

Arranges things so that the operators that the interpreter handles
specially are assigned the first N operator indices [internal change only].
(interp.h, iinit.c, interp.c)

Changes the operators max and min to .max and .min, to avoid conflicts with
PostScript programs that use these names for variables and also use 'bind'.
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE from programs that depend on
'bind' binding in these operators; however, we have also defined procedures
max and min that just call the operators, which should take care of any
ordinary code.  (*.ps, zrelbit.c)

</pre><h3><a name="V3.21_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The pfb_state pointer in the eexecDecode filter state wasn't
marked as traceable for the garbage collector.  (sfilter.h)
	- The eexec decoding filter could access invalid memory or return
garbage under some conditions.  (Bug introduced in 3.12.)  (zmisc1.c)
	- The eexec decoding filter would incorrectly ask for more input if
the output buffer was full.  (seexec.c)

</pre><h3><a name="V3.21_Library"></a>Library</h3><pre>

Fixes bugs:
	- Some compilers reserve the word 'try'.  (gshtscr.c)
	- Some compilers don't like line continuations (\) within a
preprocessor macro formal parameter list.  (gdevprn.h, gxdevice.h)
	- Memory devices created with an inverted palette (0=white,
1=black) interchanged white and black in fill operations.  (gdevmem1.c)
	- The 'bits' variable in mem_mono_copy_mono was unused on
little-endian machines.  (gdevmem1.c)
	- Some garbage collector procedures were declared 'private'
inconsistently.  (gscie.c)
	- The new anti-aliased text capability accidentally caused all
characters to be oversampled.  (gschar.c)
	- Type 1 fonts with PaintType = 2 and StrokeWidth = 0 came out with
many pixels missing because of oversampling.  (gschar.c)
	- Type 1 font stem hints were not being processed correctly.
(gstype1.h, gxtype1.h, gstype1.c, gxhint2.c, gxhint3.c, gxpath.c)
	- The tracing message for 9/7 composite fonts incorrectly
identified them as 1/7 fonts.  (gschar0.c)
	- If a 1/7 or 9/7 composite font was a child of a non-modal font,
the font number of the child font was computed incorrectly.  (gschar0.c)

Splits up the various memory devices into one file per depth [internal
change only].  (gdevm*.c)

</pre>

<h2><a name="Version3.20"></a>Version 3.20 (beta) (10/31/94)</h2>

<p>
This version contains some support for a PDF interpreter; however, the PDF
code itself is not ready for release yet.  It also includes anti-aliased text
capability.  This release was not distributed to the public.

<h3><a name="V3.20_Documentation"></a>Documentation</h3><pre>
Notes that the FAQ has moved to smallo.ruhr.de:pub/ghost/gs.faq.  (readme)

Documents various implementation limits.  (language.doc)

</pre><h3><a name="V3.20_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- bcp.dev wasn't included in the list of dependencies for
level1.dev.  (gs.mak)

Changes the printout of version numbers so that it is always A.BC,
rather than A.B if C is zero.  (gs.c, gs_init.ps)

</pre><h3><a name="V3.20_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- font2c didn't correctly handle Metrics or Metrics2 dictionaries
whose entries were arrays rather than scalars.  (font2c.ps, ccfont.h,
iccfont.c)
	- font2c didn't handle CDevProc.  (font2c.ps, ccfont.h, iccfont.c)
	- genconf could get a stack overflow on small machines.
(genconf.c)

Changes mergeini.ps so it can take arguments on the command line specifying
the input and output files.  (mergeini.ps)

Adds a gsdj500 shell script to parallel gsdj500.bat.  (gsdj500)

</pre><h3><a name="V3.20_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The X driver didn't mask dynamically assigned colors properly, so
it could request the same color over and over again.  (gdevx.c)

Adds two alternate X Windows drivers, for helping debug drivers with other
color models:
	- x11alpha, an RGB device with 4-bit alpha capability (for
	  copy_alpha only);
	- x11cmyk, a 1-bit-per-component CMYK device.
(devs.mak, gdevxalt.c)

Changes the left margin of the lj4dith driver to 0.26".  (gdevcdj.c)

</pre><h3><a name="V3.20_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- If &lt;sys/time.h&gt; didn't exist, time_.h didn't always include
&lt;time.h&gt;.  (time_.h)
	- The OS/2 platform wouldn't compile.  (gdevpm.c)
	- The auxiliary VMS command files sometimes got blank lines
inserted when going through EOL conversion.  (vms.mak; delete gs_.com)
	- The VMS makefiles didn't include the Level 1 operators in
level1.dev.  (vms.mak)
	- The VMS gcc makefile didn't handle undefined DEVICE_DEVSn
variables properly.  (vms*.mak)
	- The VMS makefiles didn't recognize DEVICE_DEVS{1,2,5,7}.
(vms.mak)

At the request of a Unix expert, changes all the Unix shell scripts to use
exec gs ... "$@" rather than gs ... $*.  (gsnd, gsbj, gsdj, gslj, gslp)

Modifies the JPEG library so that it uses 4K less of the automatic data
segment in 16-bit environments.  (bcwin.mak, jpeg.mak, sjpeg.c, sjpegerr.c)

Adds the bmp drivers back into the 16-bit MS Windows executable, since they
will fit now.  (bcwin.mak)

</pre><h3><a name="V3.20_Fonts"></a>Fonts</h3><pre>

Makes the font substitution algorithm recognize the word Roman as calling
for a serif font.  (gs_fonts.ps)

</pre><h3><a name="V3.20_Interpreters"></a>Interpreters</h3><pre>

Fixes bugs:
	- The fix in 3.13 for the inexact function values at 0 didn't work.
(zcontrol.c)
	- Level 1 configurations referenced an undefined procedure
gs_currenthalftone.  (gsht.c, gsht1.c)
	- Specifying any device properties (including -r and -g) on the
command line caused an error.  (gs_init.ps)
	- The forward declaration of cfont_name_array_create was
incorrect.  (iccfont.c)
	- save and restore could get called before the graphics state stack
had been initialized properly.  (gs_mex_e.ps)
	- Some encodings weren't loaded properly.  (gs.mak, gs_mex_e.ps,
gs_mro_e.ps, gs_pdf_e.ps, gs_wan_e.ps)
	- Zero-height images were allowed, but zero-width images
weren't.  (zpaint.c)
	- Neither zero-width nor zero-height images popped their
arguments from the operand stack.  (zpaint.c)
	- lib_file_fopen overwrote its file name argument, causing havoc
with @-files.  (gxiodev.h, gdevpipe.c, gsiodev.c, zfile.c)
	- The garbage collector got confused if there were any arrays or
dictionaries with 8K or more elements.  (igcref.c)
	- &gt;&gt; could leave the stacks in a questionable state if it failed.
(gs_init.ps)
	- The Category resource category didn't implement undefineresource.
(gs_res.ps)
	- When the token operator read the last token from a string, it
left an unchanged string on the stack instead of an empty string.
(stream.c)
	- noaccess didn't give an invalidaccess error when applied to the
permanent dictionaries.  (dstack.h, idict.c, ztype.c)
	- Overflowing the exec stack wasn't handled properly.  (istack.h,
istack.c)
	- The garbage collector cleared the cached value pointers in names,
causing interpretation to slow down substantially.  (idict.c, igc.c,
iname.c)
	- 0 dict created a dictionary with a maxlength of 1.  (idict.c)

Changes the default size of the execution stack from 150 to 250, to match
the Adobe "typical" value.  (interp.c)

Moves the operator definitions out of the automatic data segment.
(opdef.h, iinit.c, z*.c)

Adds operators that allow creation of objects in system space:
.systemvmstring, .systemvmarray, .systemvmpackedarray, .systemvmdict,
.systemvmcheck.  (zsysvm.c)

Renames gcdefs.h as gscdefs.h.

Allocates names in system space rather than global space.  (gsmain.c)

Changes the memory manager so that it allows programs to create objects in
system space.  (iref.h, iutil.h, ivmspace.h, ...)

Changes the implementation of filters so they appear in their own
dictionary named filterdict.  (gs_init.ps, z*.c)

Changes the implementation of color spaces so each one has its own
setcolorspace procedure, defined in a new dictionary named
colorspacedict.  (gs_lev2.ps, z*.c)

Adds a new debugging switch, $, that always initializes all fields in a
ref, in order to keep Purify happy.  (store.h)

</pre><h3><a name="V3.20_Library"></a>Library</h3><pre>

Fixes bugs:
	- The page size for image devices was always set to (0, 0).
(gsdevice.c)
	- The PageSize computation in gx_default_put_params could overflow
on 16-bit machines.  (gsdparam.c)
	- An omitted 'static' on an initialized array caused a compiler
error.  (gxccman.c)
	- If interpolated image rendering was requested but not
actually carried out, gs_image_cleanup could attempt to free a random
pointer.  (gsimage.c)
	- Some compilers only retain 23 characters of procedure names, but
some procedure names weren't unique in the first 23 characters.  (gscie.c,
gscolor.c, gscolor1.c, gxcmap.c)
	- The garbage collector didn't trace device colors properly.
(gxdcolor.h, gzht.h, gsimage1.c, gspcolor.c, gxcht.c, gxcmap.c, gxdraw.c,
gxht.c)
	- For CMYK devices, the transfer functions were being applied to
the CMYK values rather than the complemented RGBW values.  (gxcmap.c)
	- Memory devices used their own color mapping procedures rather
than those of the target; this could cause incorrect colors for patterns on
devices with more than 1 bit per pixel.  (gxdevmem.h, gdevmem1.c, gdevpm.c,
gdevprn.c, gdevwdib.c, gschar.c, gsdevice.c, gxccache.c, gxccman.c,
gxclip2.c, gxclread.c, gxpcmap.c)
	- The garbage collector didn't trace image enumerators properly in
the image_render_simple case.  (gsimage.c)
	- stroke produced different-looking output for thin (zero-width)
lines depending on whether or not clipping was invoked.  (gxstroke.c)
	- If a clipping list changed from multiple rectangles to a single
rectangle, it could fail to clip properly thereafter.  (gxacpath.c)

Adds two new device procedures: alpha_bits and copy_alpha.  This change is
backward-compatible for all existing devices.  (gdevmem.h, gxdevice.h,
gsdevice.c, gxclip2.c, gxclist.c, gxcpath.c)

Changes the implementation of color halftones so that, when appropriate, it
generates a single cell and uses the device tile_rectangle procedure.
(gzht.h, gsht.c, gxcht.c, gxclist.c, gxclread.c)

Adds partial support for the Orientation page device parameter.
(gsdevice.c)

Adds support for anti-aliased characters using 2 or 4 bits of alpha.
(gxfcache.h, gschar.c, gxccache.c)

</pre>

<hr>

<h2><a name="Version3.13"></a>Version 3.13(private) (10/3/94)</h2>

<p>
This release was created for a customer; it was not distributed to the
public.

<h3><a name="V3.13_Documentation"></a>Documentation</h3><pre>
Notes in make.doc that the file names in the IJG archive distributed with
Ghostscript do not include the gsA.BC/ prefix.  (make.doc)

Adds a cross-reference to make.doc to the Watcom makefiles.  (watc.mak,
watcwin.mak, wccommon.mak)

</pre><h3><a name="V3.13_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The makefile rule for gconfig.h et al had a couple of blank lines
in the middle of it.  (gs.mak)

</pre><h3><a name="V3.13_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- wrfont.ps didn't add a lenIV entry to the Private dictionary if
it was needed.  (wrfont.ps)

Adds a packfile.ps utility that allows compressing multiple files into a
single file for environments with very little permanent storage.
(gs_pfile.ps, packfile.ps, wrfont.ps)

</pre><h3><a name="V3.13_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The {tiff,fax}{g32d,g4} devices could produce incorrect output.
See under Streams below.
	- The dfax drivers referred to the obsolete structure member
EncodedEOLAlign.  (gdevdfax.c)

Changes the default bit order for TIFF/F output to little-endian, which is
apparently what the majority of TIFF decoders like best.  The bit order for
the fax drivers is still big-endian.  (gdevdfax.c, gdevtfax.c)

</pre><h3><a name="V3.13_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The VMS build script used -a rather than -w for creating
gconfig_.h.  (vms.mak)
	- The VMS build script didn't create gconfigv.h.  (vms.mak)
	- The VMS Fontmap had incorrect entries for the Bitstream Charter
fonts.  (fontmap.vms)
	- The VMS MODULES.LIS file assumed the JPEG library files were in
directory JPEG rather than JPEG-5.  (modules.lis)

</pre><h3><a name="V3.13_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Using DISKFONTS resulted in an invalidaccess error.
(gs_fonts.ps)

</pre><h3><a name="V3.13_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- The standard transfer function considered gray values above
roughly 0.994 equivalent to white; 0.999 is a better value.  (gs_init.ps)
	- The transfer, black generation, and undercolor removal functions
gave slightly inexact results for an input value of 0.  (zcolor.c,
zcontrol.c)
	- setpagedevice gave an /undefined error if it did not recognize a
key, rather than ignoring the key.  (zdevice.c, gs_init.ps, gs_lev2.ps,
gs_setpd.ps)

Changes .putdeviceparams to take an additional argument, a Boolean that
says whether or not unrecognized keys should be reported as /undefined
errors.  THIS IS A NON-BACKWARD-COMPATIBLE CHANGE; however, no user-written
code should be calling .putdeviceparams.  (zdevice.c)

</pre><h3><a name="V3.13_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The Group 3 2-D and Group 4 fax encoders could emit incorrect
output.  (scfe.c)
	- The algorithm for constructing optimal Huffman codes could
produce invalid codes in some rare cases.  (shcgen.c)

</pre><h3><a name="V3.13_Library"></a>Library</h3><pre>

Fixes bugs:
	- Rectangles closed with lineto rather than closepath weren't
recognized as rectangles.  (This only affected performance, not
functionality.)  (gxpath2.c)
	- The xfont lookup_font procedure could get called with a matrix
whose translation components had never been initialized.  (gxccman.c)
	- Some compilers don't allow \ in the formal argument list of a
preprocessor macro.  (gdevprn.h, gxdevice.h)

</pre>

<h2><a name="Version3.12"></a>Version 3.12 (9/29/94)</h2>

<p>
This is another bug fix release, the first Level 2 release that we believe
is reasonably reliable.

<h3><a name="V3.12_Documentation"></a>Documentation</h3><pre>

Adds some text warning about making copies of the makefile.  (make.doc)

</pre><h3><a name="V3.12_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- There were a number of unnecessary dependencies on $(MAKEFILE) in
gs.mak, left over from before the existence of gconfigv.h.  (gs.mak)
	- JPEGSRC was defined in gs.mak rather than in jpeg.mak.  (gs.mak,
jpeg.mak)

Changes the version numbering scheme back to A.BC, since people seem to be
adapting to the change, and this allows using the version number directly
as a MS-DOS directory name.  (gconfig.c, gdevtfax.c, gs.c, gs_init.ps)

Updates the JPEG library to version 5 (official release) of the IJG code.
(jpeg/*, jpeg.mak)

</pre><h3><a name="V3.12_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The TIFF/F driver put out invalid PageNumber and Software
entries.  (gdevtifs.h, gdevtfax.c)
	- The TIFF/F and fax Group 3 2-D drivers used K=3 and K=5 instead
of K=2 and K=4.  (gdevtfax.c)
	- The TIFF/F and fax Group 3 2-D drivers emitted improperly aligned
output.  (See under Streams below.)
	- The MS Windows driver didn't resize the window properly in
response to changing the device parameters.  (gdevmswn.c)

Because of complementary bugs in various C compilers, changes all the
non-printer devices to use a different set of macros.  (gdevmem.h,
gdevpcfb.h, gdevprn.h, gdevsvga.h, gxdevice.h, gdev{3b1, bgi, herc, l256,
pe, pm, sun, vglb, wddb, wdib, wprn, x}.c, gsdevice.c, gxacpath.c,
gxclip2.c, gxcpath.c, gxpcmap.c, zupath.c)

Changes the X11 driver to ignore the "margins" specified by Ghostview.
This is apparently necessary for Ghostview to handle landscape display
properly.  (gdevxini.c)

Adds a WindowID parameter to the X11 device, to allow setting the window
for the output.  (gdevx.h, gdevx.c, gdevxini.c)

</pre><h3><a name="V3.12_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The definition of BEGINFILES in os2.mak occurred too late in the
file to have the desired effect.  (os2.mak)

</pre><h3><a name="V3.12_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Updating the list of allocated file objects at a restore didn't
clear the prev pointer of the new head, which could cause the garbage
collector to encounter an invalid pointer.  (Bug introduced by .forgetsave
in 3.0.3.)  (zfile.c)

</pre><h3><a name="V3.12_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The CCITTFaxEncode filter with K &gt; 0 and EncodedByteAlign = true
incorrectly aligned the 1-D/2-D bit as the last bit of a byte, rather than
the first bit.  (scfx.h, scfe.c)
	- eexec could loop indefinitely under certain conditions.
(seexec.c)
	- eexec's algorithm for recognizing text vs. binary encoding didn't
work properly in some cases that don't conform to the Adobe Type 1 Font
Format documentation.  (seexec.c)
	- Closing a stream didn't clear out the strm and state pointers,
which could cause invalid accesses by the garbage collector.  (stream.c)

</pre><h3><a name="V3.12_Library"></a>Library</h3><pre>

Fixes bugs:
	- fill_loop could loop indefinitely under certain conditions.
(Introduced by a bug fix in 3.1.)  (gxfill.c)
	- fill/eofill sometimes failed to paint parts of a region.
(Introduced by a bug fix in 3.1.1.)  (gxfill.c)
	- Non-convex clipping paths sometimes omitted thin horizontal
slivers of the region.  (Probably introduced by the "thin graphics" fix in
3.1.)  (gxacpath.c)

</pre>

<h2><a name="Version3.1.1"></a>Version 3.1.1 (9/25/94)</h2>

<p>
This is primarily a bug fix release.  It was originally intended for some
commercial licensees, but beta testers found too many problems with it.

<h3><a name="V3.1.1_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- NEWS didn't indicate that there was a non-backward-compatible
change in the gx_device structure -- specifically, that l_margin,
b_margin, r_margin, and t_margin were replaced by macros named
dev_l_margin(dev), etc.  (news)

Describes the two-phase commit requirement for device put_params
procedures.  (drivers.doc, gsparam.h)

</pre><h3><a name="V3.1.1_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The new S macro in genarch.c didn't work on compilers that do
macro substitution within string constants (which is forbidden by the ANSI
standard).  (genarch.c)

</pre><h3><a name="V3.1.1_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- Driver put_params implementations didn't observe a "two-phase
commit" discipline; this could lead to the current device in the graphics
state being closed, and other inconsistencies.  (gsparam.h, gxdevice.h,
iparam.h, gdevbit.c, gdevcdj.c, gdevmswn.c, gdevpcfb.c, gdevpm.c,
gdevprn.c, gdevx.c, gsdevice.c, gsdparam.c, zdevice.c, ziodev2.c, zmisc2.c)
THIS IS A NON-BACKWARD-COMPATIBLE CHANGE; however, it only affects
put_params implementations, of which there are few.

NOTE THE NON-BACKWARD-COMPATIBLE CHANGE IN THE gx_device STRUCTURE UNDER
'Documentation' ABOVE.  (gdevescp.c, gdevsj48.c, gdevsppr.c, gdevxini.c)

</pre><h3><a name="V3.1.1_Platforms"></a>Platforms</h3><pre>

Ensures that the Unix makefiles all include all the variants of TIFF/F and
fax drivers.  (ansihead.mak, cc-head.mak, gcc-head.mak)

</pre><h3><a name="V3.1.1_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Most of the contents of statusdict were missing when
running a Level 2 system in Level 1 mode.  (zmisc2.c)

</pre>

<h2><a name="Version3.1"></a>Version 3.1 (9/20/94)</h2>

<p>
This release finally includes a usable subset implementation of
setpagedevice, including all the machinery needed to address the
long-standing "margins" problems.

<h3><a name="V3.1_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- t_oparray objects weren't identified as behaving differently
depending on whether they were marked executable.  (iref.h)
	- drivers.doc had gx_color_value instead of gx_color_index in
the description of color mapping.  (drivers.doc)

Updates drivers.doc to reflect the change from static_procs to
std_procs in the gx_device structure.  (drivers.doc)

</pre><h3><a name="V3.1_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The commands for building the JPEG library used rm instead
of rm -f.  (jpeg.mak)

</pre><h3><a name="V3.1_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The X Windows driver hadn't been updated to reflect some
name changes in members of the gx_color_info structure.  (gdevx.h,
gdevx.c, gdevxini.c)

Changes all non-printer drivers so that they use the new std_device_body
macros.  (gdev*.c)

Adds a print_page_copies procedure for printer drivers, allowing the
driver to receive num_copies.  (gdevprn.h, gdevprn.c)

</pre><h3><a name="V3.1_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- ref_memory_enum/reloc_ptrs were declared inconsistently.
(ialloc.c)
	- If the operand of restore was invalid, the restore did
nothing, instead of giving a typecheck.  (zvmem.c)
	- In Level 2, the margins and setmargins compatibility
operators were defined incorrectly in terms of current/setpagedevice.
(gs_lev2.ps)

Enables .makeoperator to make local operators as well as global ones.
(opdef.h, iinit.c, zmisc.c, zpacked.c)

Finishes implementing the TransferFunction entry in halftone
dictionaries.  (zht1.c, zht2.c)

Adds .set/currentfilladjust operators for access to the fill
adjustment parameter in the graphics state.  (zgstate.h)

Removes the deviceinitialmatrix operator.  (zdevice.c)

Changes defaultmatrix from a procedure to an operator.  (zmatrix.c)

Sets the fill adjustment to 0.5 for high-resolution devices, effectively
implementing Adobe's any-part-of-pixel filling rule.  (gs_init.ps)

Implements a small but useful subset of setpagedevice.  (gs_lev2.ps)

</pre><h3><a name="V3.1_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The eexec decoder incorrectly concluded that its data was
in hex form if the first data character was whitespace.  (seexec.c)

</pre><h3><a name="V3.1_Library"></a>Library</h3><pre>

Fixes bugs:
	- Thin graphics (e.g., lines or rectangles) with small angles
relative to the X axis rendered with many points missing.  (gxdraw.c,
gxfill.c)
	- The character cache rejected oversampled characters if the
scaled-up size was too large, even if the scaled-down size wasn't.
(gxchar.h, gschar.c, gxccache.c, gxccman.c)
	- A call on sqrt with an integer argument didn't promote it
explicitly to double, which is required for non-ANSI compilers.
(gshtscr.c)

Finishes implementing the TransferFunction entry in halftone
dictionaries.  (gsht1.c)

Modifies the character oversampler so it can produce gray scale
output instead of a 1-bit mask.  We don't actually make use of this
ability yet.  (gxccman.c)

Adds gs_set/currentfilladjust for access to the fill adjustment
parameter in the graphics state.  (gsstate.h, gsstate.c)

Changes the names of the last few routines beginning with gz_ to
begin with gx_ instead.  (gzdraw.h =&gt; gxdraw.h, gsimage*.c, gxdraw.c,
gxfill.c, gxstroke.c)

Properly implements the PageSize, Margins, .HWMargins, and ImagingBBox
device parameters for all devices.  (gscoord.c, gsdparam.c, gspath2.c)
Implements the NumCopies device parameter for printer devices.
(gdevprn.c)

Implements std_device_body macros to help insulate statically initialized
non-printer devices from future changes in the gx_device structure.
(gxdevice.h, ... many .c files ...)

</pre>

<hr>

<h2><a name="Version3.0.3"></a>Version 3.0.3 (9/16/94)</h2>

<p>
This is primarily a bug fix release; it also implements most of the
remaining Level 2 loose ends (except for setpagedevice).

<h3><a name="V3.0.3_Documentation"></a>Documentation</h3><pre>

Changes code that refers to "Ghostscript" to use the correct product
name from gs_product.  (gs.mak, gdevpbm.c, gdevsun.c, gswppm.c)

Documents the new .forgetsave operator.  (language.doc)

Clarifies the distinction between commercial licensing and single-copy
end-user sales.  (readme)

</pre><h3><a name="V3.0.3_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- The compilation rule for gdevadmp.c was missing from the
makefile.  (devs.mak)

Changes the version numbering scheme back to A.B.C, since too many
people got confused by the change to A.BC.  (gconfig.c, gs.c,
gs_init.ps)

Adds a -dNOGC switch to prevent the garbage collector from being
enabled.  (gs_init.ps)

</pre><h3><a name="V3.0.3_Utilities"></a>Utilities</h3><pre>

Removes the ps2image utility, since the new psmono driver replaces it.

</pre><h3><a name="V3.0.3_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The TIFF drivers incorrectly assumed that short and ulong
were the same size as TIFF_short and TIFF_ulong, causing problems on
64-bit systems.  (gdevtfax.c)
	- The EGA/VGA driver didn't do gray halftones properly if it
was configured as a monochrome or 8-color device.  (gdevpcfb.h)
	- The comment in gdevevga.c incorrectly identified the file
as gdevpcfb.c.  (gdevevga.c)

Changes the PC display drivers to save and restore more of the BIOS
state.  (gdevpcfb.h, gdevevga.c, gdevpcfb.c, gdevsco.c)

Adds a new psmono driver that does the same thing as ps2image, faster
and more conveniently.  (gdevpsim.c)

Replaces the X11 driver with the one from 3.01, since the color
handling rewrite in 3.02 introduced serious bugs.  (gdevx.h, gdevx.c,
gdevxini.c)

</pre><h3><a name="V3.0.3_Platforms"></a>Platforms</h3><pre>

Changes the definition of gx_no_color_index to work around one of the
bugs in the SGI Irix compiler.  (gxdcolor.h)

Rewrites the installation commands in unix-end.mak so they don't have
very long lines.  (unix-end.mak)

</pre><h3><a name="V3.0.3_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Fonts that used 2- or 4-element arrays in the Metrics dictionary
interpreted the width and side bearing interchanged with each other.
(gs_type1.ps)
	- Setting FONTPATH on the command line didn't work.  (gs_fonts.ps)

</pre><h3><a name="V3.0.3_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The stream position wasn't updated properly if sgets
crossed a buffer boundary.  (stream.c)

Extends the BoundedHuffman filters so they can encode and decode runs of
zeros specially, and so they mark and detect EOD.  (sbhc.h, shc.h, sbhc.c,
zfilter2.c)

Provides an alternate implementation of file streams which doesn't use
stdio buffering and which works around the System V "interrupted system
call" problem.  (stream.c, sfile.c, sfileno.c)

Increases the maximum LZW output code from 3000 to 4095.  (slzwe.c)

</pre><h3><a name="V3.0.3_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- Opening a filter on a file of the wrong access type (read
vs. write) didn't cause an error.  (stream.h, sbasic.c, zfile.c, zfileio.c)
	- save performed an extra, unnecessary gsave.  (zvmem.c)
	- sethalftone always gave a /undefined error.  (zht2.c)
	- eexec decryption read too much data from the input -- in
Level 2, it isn't allowed to read 512 characters ahead.  (sfilter.h,
strimpl.h, seexec.c, sstring.c, zfileio.c, zmisc1.c)
	- The scanner was too aggressive about allocating additional
space for strings on small machines.  (iscan.c)
	- The AccurateScreens flag in Type 1 and Type 2 halftone
dictionaries was being ignored.  (zht2.c)
	- The Level 2 definition of margins in statusdict didn't
allow for Margins being undefined in the current page device.
(gs_lev2.ps)
	- The Interpolate flag was being ignored in image
dictionaries.  [implemented in library]
	- The TransferFunction option was being ignored in halftone
dictionaries.  (zht2.c)
	- Type 5 halftones usually didn't work, because they called
the wrong (or an invalid) spot function.  (zht2.c)

Implements a .forgetsave operator that effectively causes a given save (and
all more recent saves) to disappear.  (isave.h, stream.h, isave.c, zfile.c,
zvmem.c)

</pre><h3><a name="V3.0.3_Library"></a>Library</h3><pre>

Fixes bugs:
	- In the 1-operand form of the image operator, a Decode value of [1
0] with 8-bit sample values and a single data source was treated the same
as [0 1].  (gsimage1.c)
	- Some Monotype fonts put a callsubr between an OtherSubr call and
the following 'pop' opcodes (which the Adobe documentation forbids); The
Type 1 font interpreter gave an invalidfont error rather than allowing
this.  (gxtype1.h, gstype1.c)
	- Patterns didn't implement XStep and YStep properly.
(gxpcolor.h, gspcolor.c, gxclip2.c)
	- Clipping regions were sometimes 1 pixel too small at the edges;
this could cause vertical and horizontal lines produced by certain Windows
drivers to disappear.  (gzpath.h, gxacpath.c, gxcpath.c, gxfill.c)
	- Oversampling cached rotated characters produced very bad
results (many dropouts).  (gschar.c)
	- Rendering a DeviceGray color on a DeviceCMYK device applied
the transfer function to all 4 components, not just to the K
component.  (gxcmap.c)
	- A screen specified with setcolorscreen didn't take effect
properly on CMYK devices.  (gsht.c)

Implements the Interpolate option for images.  Currently this is only
implemented for portrait-orientation images (no rotation, skewing, or
X-reflection).  (gscspace.h, gximage.h, gscie.c, gscolor.c, gscolor1.c,
gscolor2.c, gspcolor.c, gxcmap.c, gsimage.c, gsimage2.c, gsimage3.c)

Implements AccurateScreens, but only in the form of a larger limit on
the size of a halftone super-cell.  (gxht.h, gsht.c, gsht1.c)

Starts to implement the TransferFunction option for halftones.
(gzht.h, gzstate.h, gsht.c, ...too many others to list...)

</pre>

<h2><a name="Version3.02"></a>Version 3.02 (8/30/94)</h2>

<p>
This is another bug fix release.  It was distributed only to a few people,
since the new X Windows color mapping code is not reliable yet.

<h3><a name="V3.02_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- make.doc, but not unixtail.mak, called for setting PLATFORM=unix_
on SVR4 platforms.  (unixtail.mak)
	- drivers.doc contained some wording that suggested that
Ghostscript always used RGB colors internally.  (drivers.doc)
	- The definition of gx_device in drivers.doc had gotten out of sync
with gxdevice.h.  (drivers.doc)
	- README claimed that Ghostscript is not compatible with the
VAX/VMS DEC C compiler, which is no longer true.  (readme)

Adds a new section on printer drivers to drivers.doc.  (drivers.doc)

Adds a large number of new display boards to the 800x600 SVGA section of
use.doc.  (use.doc)

Adds a bug report form to the README file.  (readme)

Notes that OSF/1 AXP systems require changing the definition of INSTALL
from install to installbsd.  (make.doc)

</pre><h3><a name="V3.02_Procedures"></a>Procedures</h3><pre>

Removes -Wno-uninitialized from the gcc flags, and fixes all the places (in
Aladdin's code only) that need to be fixed to pacify gcc after doing this.
(gcc-head.mak, gdevgif.c, gdevmem2.c, gdevpcl.c, gs.c, gsht1.c, gsimpath.c,
gsutil.c, gxclread.c, gxpcopy.c, gxstroke.c, idict.c, iscannum.c, stream.c,
zdevice2.c) (NOT FINISHED YET)

Adds a FAKEFONTS switch that makes fake entries in FontDirectory for
unloaded fonts, for the benefit of programs that think they can find all
the available fonts by scanning FontDirectory.  (gs_fonts.ps, gs_init.ps)

</pre><h3><a name="V3.02_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- ps2epsi didn't work, because setdevice now erases the page.
(ps2epsi.ps)
	- ps2epsi didn't work, because -dNODISPLAY installs a null device
with 0 width and height.  The fix -- to remove the -dNODISPLAY -- is not
satisfactory, because it opens an unnecessary window.  (ps2epsi)

</pre><h3><a name="V3.02_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- gdev_fax_open was incorrectly declared static in gdevtfax.c,
causing the extern reference in the dfax drivers not to be resolved.
(gdevtfax.c)
	- devs.mak included a duplicate definition of gdevmswn_h.
(devs.mak)
	- The fax drivers didn't link properly in Level 1 systems, because
shc.c was omitted from their dependency list.  (gs.mak, devs.mak)
	- The TIFF/F drivers didn't set RowsPerStrip properly.
(gdevtfax.c)
	- The TIFF/F drivers didn't byte-align the EOL properly.  (scfx.h,
gdevdfax.c, gdevtfax.c, scfe.c, zfilter2.c)
	- The rule for compiling gdevpccm.c incorrectly specified
dependency on gs.h rather than gx.h.  (devs.mak)
	- The rule for compiling gdevtfax.c didn't include time_.h as a
dependency.  (devs.mak)
	- The mode 2 compression routine for the DeskJet/LaserJet printers
was broken.  (gdevpcl.c)

Removes the -O0 from the compilation rule for gdevsco.c, since it was
misplaced to begin with.  (devs.mak)

Adds a maxDynamicColors X resource to control dynamic allocation in the
color map.  Replaces the X color lookup algorithms with completely new
ones, for a substantial performance gain.  (gdevx.h, gdevx.c, gdevxini.c)

Adds PageNumber, Software, and DateTime entries to the TIFF/F drivers.
(gdevtifs.h, gdevtfax.c)

Changes the margins for the LaserJet 4 to 0.  (gdevdjet.c)

Adds a user-contributed LaserJet 4 driver that does Floyd-Steinberg
dithering.  (gdevcdj.c)

</pre><h3><a name="V3.02_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The exit codes for Ghostscript should be different on VMS.
(iastate.h, gs.c, gsmain.c, igc.c, igcref.c)
	- The VMS DEC C compiler declares malloc and free in stdlib.h, and
delete and unlink in stdlib.h.  (malloc_.h, stdio_.h)
	- st_prn_device wasn't defined, which upset the VMS linker even
though there were no references.  (gdevprn.h)
	- stdpre.h didn't bring in the right headers when running gcc on
SCO Unix, causing compilation warnings/errors.  (stdpre.h)
	- The definition of rename in gp_sysv didn't include const for the
arguments.  (gp_sysv.c)
	- The definition of gettimeofday in gp_sysv didn't return any
value.  (gp_sysv.c)
	- time_.h didn't work on MS-DOS systems.  (time_.h)
	- math_.h didn't include &lt;math.h&gt; when compiling with gcc on VMS
systems.  (math_.h)
	- DesqView/X doesn't have a 'cat' command, which caused problems in
the linking step.  (dvx-tail.mak)

Changes the definitions of popen in gdevpipe.c and gp_unix.c so they don't
specify the argument list.  This is an attempt to get around the fact that
there is no easy way to detect whether the available header files declare
popen correctly (with const arguments), incorrectly (with non-const
arguments), or not at all.  (gdevpipe.c, gp_unix.c)

Replaces VMS.MAK, VMS-CC.MAK, and VMS-AXP.MAK with new versions provided by
a user.  (vms.mak, vms-cc.mak, vms-axp.mak)

Changes the 16-bit Borland makefiles so their standard configuration is
Level 1 plus color.dev (CMYK color and colorimage).  (bc.mak, bcwin.mak)

</pre><h3><a name="V3.02_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- cfonts.mak still referred to some .gsf files that have been
replaced by .pfa files.  (cfonts.mak)
	- Compiled fonts got entered into FontDirectory, but didn't get
registered as resources.  (gs_ccfnt.ps)
	- The Cyrillic, Kana, Hershey .gsf, and URW fonts didn't include a
necessary systemdict begin/end, which caused them to fail in badly designed
environments.  (fonts/f*.gsf, fonts/h*.gsf, fonts/?0*.gsf)

Changes the default target directory in cfonts.mak from fonts/c to .;
changes the names of the Zapf Chancery compiled font procedures from c* to
zc*.  (cfonts.mak)

Adds more fonts from the Adobe Type Manager package for MS Windows to
Fontmap.ATM.  (fontmap.atm)

Adds the entire set of 35 standard fonts to the ccfonts feature in gs.mak;
removes all the compilation rules for compiled fonts, since these rules are
in cfonts.mak already.  (gs.mak)

</pre><h3><a name="V3.02_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- kshow executed a null, rather than the correct procedure, between
the characters of the string, and got a typecheck error at the end.
(zchar.c)
	- MultiMaster fonts computed their side bearing and width
incorrectly, producing incorrect output.  (zchar1.c)
	- There was no structure definition for gs_type1_state, so a GC
during the execution of an OtherSubrs procedure could scramble pointers in
the saved state.  (zchar1.c, zfont1.c; also affects library, see below)
	- kshow didn't work properly if the kerning procedure changed the
depth of the operand or dictionary stack.  (zchar.c)
	- If the element count for roll was too large by only 1 or 2, the
result was a crash rather than a rangecheck.  (zstack.c)
	- restore didn't undo currentgstate.  (igstate.h, store.h,
gsstate.c, zdevice2.c, zdps1.c, ztype.c)
	- The scanner didn't set the local bit properly in a suspended
state.  (iscan.c)
	- copypage disregarded #copies.  (gs_init.ps)
	- An incorrectly declared pointer led to addressing faults on
16-bit systems.  (zchar1.c)
	- The cache for Separation colors was allocated with one element
too few.  (zcsindex.c)

Changes `executive' so that if an error other than EOF occurs in the
reading of the statement, the interpreter prints the error message, but
control remains in the executive loop.  (This isn't a very good fix; a
better one will require refactoring executive / execute / run.)
(gs_init.ps)

Changes dictionary undo saving to use the new ref_must_save macro [internal
change only].  (idict.c)

Moves configuration definitions from iinit.c to gconfig.c.  (gcdefs.h,
interp.h, gconfig.c, gs.c, iinit.c, zmisc2.c, gs.mak)

Moves =string from systemdict to userdict for Adobe compatibility.
(gs_init.ps)

Starts to implement the Interpolate flag in image dictionaries.  See under
Library below for restrictions.  (zpaint.c, zimage2.c)

</pre><h3><a name="V3.02_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- stream_compact attempted to compact a read-only string being used
as the data source of a filter.  (sbasic.c, stream.c)

Adds an EncodedEOLAlign flag to the CCITTFaxEncode stream, to allow direct
generation of TIFF/F output.  (scfx.h, scfe.c, zfilter2.c)

</pre><h3><a name="V3.02_Library"></a>Library</h3><pre>

Fixes bugs:
	- There was no structure definition for gs_type1_state, so a GC
during the execution of an OtherSubrs procedure could scramble pointers in
the saved state.  (gxfont1.h, gxtype1.h, gstype1.c, gxhint2.c)
	- A couple of calls had to discard const, but didn't include the
necessary cast.  (gxpcmap.c)
	- makeimagedevice refused to accept an empty image.  (gsdevice.c)
	- The extra parentheses around arguments in memory_.h caused some
compilers to fail.  (memory_.h)
	- Floating point overflows during coordinate conversion terminated
Ghostscript.  (gxfarith.h, gxfixed.h, gsmatrix.c, gsmisc.c)
	- Accents still weren't getting placed properly on characters
created with seac.  (gstype1.c, gxhint2.c)
	- The SGI C compiler couldn't handle the (perfectly legal)
definitions of dev_init_[open_]misc.  (gxdevice.h)
	- string_.h caused some problems with gcc on some versions of
Solaris.  (string_.h)
	- The halftone levels for color screens were computed incorrectly.
(gzht.h, gxdither.c)
	- Color screens sometimes had vertical stripes of solid color
interspersed.  (gxcht.c)
	- Colors could get mapped incorrectly if a compiler aggressively
(and incorrectly) reordered the computation of procedure arguments
involving the unit_frac macro.  (gxcmap.c)
	- setcachedevice[2] insisted that the corners of the bounding box
be given in the correct order, i.e., llx &lt; urx and lly &lt; ury.  (gschar.c)
	- The image operator gave a limitcheck on unrotated 1-bit-per-pixel
images whose width in device coordinates exceeded 65529.  (gsimage.c)
	- The garbage collector didn't trace the input data of an
in-progress image operator correctly.  (gsimage.c)

Changes the max_rgb and dither_rgb members of gx_device_color_info to
max_color and dither_colors, since Ghostscript now uses these for CMYK
devices as well.  Also changes dither_gray to dither_grays.  (gdevmem.h,
gdevprn.h, gxdevice.h, gdevbit.c, gdevcdj.c, gdevprn.c, gdevxini.c,
gsdparam.c, gxcht.c, gxcmap.c)

Starts to implement the Interpolate option for images.  Currently this is
only implemented for image, not imagemask, and only for rotations that are
multiples of 90 degrees (possibly with reflection).  (gsimage.h,
gsiscale.h, gximage.h, gsimage.c, gsimage1.c, gsiscale.c)

Starts to implement XStep and YStep in pattern dictionaries.  (gxdcolor.h,
gxpcolor.h, gspcolor.c, gxpcmap.c)

</pre>

<h2><a name="Version3.01"></a>Version 3.01 (8/14/94)</h2>

<p>
This is a patch release to fix early problems in release 3.0, and to clean
up a few known loose ends.

<h3><a name="V3.01_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- language.doc still documented the devicename procedure, which has
been withdrawn.  (language.doc)
	- drivers.doc didn't specify under what circumstances each
procedure could be called.  (drivers.doc)
	- current.doc said that setcachedevice and makeimagedevice wouldn't
accept packed arrays, but neither of these operators takes any array
arguments.  (current.doc)
	- current.doc said that definefont didn't interact properly with
the resource machinery, which apparently is no longer true.  (current.doc)
	- make.doc incorrectly gave the name of the DVX makefile as
dvx-djg.mak rather than dvx-gcc.mak.  (make.doc)
	- In one place, devices.doc incorrectly used -sBitsPerPixel= rather
than -dBitsPerPixel=.  (devices.doc)

Notes that a kernel bug in SCO Unix makes Ghostscript not work correctly in
some circumstances.  (use.doc)

</pre><h3><a name="V3.01_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- devs.mak incorrectly referred to gdevjetp.c instead of
gdev3852.c.  (devs.mak)
	- The obsolete file gsprops.c was accidentally included in the
fileset.

Changes the version numbering scheme from A.BCC to A.B[C].  E.g., this
release will be 3.01, not 3.001.  (gs_init.ps, gs.c, iinit.c)

Adds the LaserJet 4 driver to all makefiles that already include the
LaserJet 3 driver.  (*.mak)

Adds the BJ-200 driver to all makefiles that already included the BJ-10e
driver.  (*.mak)

Splits the Unix 'install' target into install-exec and install-data.  Moves
the executable scripts from gsdatadir to a new directory scriptdir, which
defaults to bindir.  (ansihead.mak, cc-head.mak, gcc-head.mak,
unix-end.mak)

</pre><h3><a name="V3.01_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- genconf had fixed buffer sizes built into it, which it could
overrun its working storage without checking.  (genconf.c)

Removes RCS or SCCS headers from two utility files.  (pj-gs.sh,
printafm.ps)

</pre><h3><a name="V3.01_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The new dfaxhigh and dfaxlow drivers didn't set
state.EncodedByteAlign to false.  (gdevdfax.c)
	- The sunview driver assumed that the device would be open before
map_rgb_color was called.  (gdevsun.c)
	- The CP50 driver incremented page_count itself, rather than
letting the core library do it.  (gdevcp50.c)
	- The GIF driver(s) could loop indefinitely under certain
circumstances.  (gdevgif.c)
	- The Group 4 fax drivers incorrectly included end-of-line codes in
the output.  (gdevtfax.c, gdevdfax.c)
	- The Group 4 fax drivers could put out an EOB in the middle of the
data.  (scfe.c)
	- The DesignJet 650C driver didn't use the correct compression
mode.  (gdevcdj.c)
	- The Hercules and EGA/VGA/SVGA drivers computed the page height
incorrectly according to the A4 switch.  (gdevherc.c, gdevpcfb.h)

Changes the page_count and showpage_count members of the device structure
from int to long.  (gxdevice.h, gdevprn.c, gsdparam.c)

Changes the faxg3, faxg32d, and faxg4 drivers so that, like the TIFF and
dfax drivers, they adjust the page size to one of the three CCITT standard
sizes if this is reasonable.  (gdevtfax.c)

Splits the bit driver into bit, bitrgb, and bitcmyk.  Adds bitrgb and
bitcmyk to all makefiles that included bit.  (*.mak, devs.mak, gdevbit.c)

Replaces the atiw16, tseng16, and tvga16 SuperVGA drivers with a single
svga16 driver that allows specifying the display mode number.  (devs.mak,
gdevpcfb.c)

</pre><h3><a name="V3.01_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- The MS Windows and OS/2 drivers allocated their terminal input
buffers in a way that could cause the GC to crash.  (gp_mswin.c, gp_os2.c)
	- The handling of gettimeofday on SVR4 platforms was incorrect.
(time_.h, gp_sysv.c, gp_unix.c)
	- On some platforms, function prototypes were not enabled even if
__STDC__ was defined.  (stdpre.h)
	- The VMS build script referred to an obsolete feature lev2only.
(vms.mak)

Changes the DVX platform so that stdprn is buffered.  This should improve
printing performance dramatically.  (gp_dvx.c)

</pre><h3><a name="V3.01_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- Setting DISKFONTS resulted in a reference to FontFileDirectory
before it was defined.  (gs_type1.ps, gs_fonts.ps)
	- /Font findresource gave an error rather than doing font
substitution.  (gs_res.ps)
	- FontDirectory wasn't rebound to GlobalFontDirectory when global
VM was current.  (gs_res.ps, zdict.c)
	- Type 1 fonts weren't loaded into global VM.  (gs_fonts.ps)
	- In the standard Fontmap, the Utopia fonts had extension .gsf
rather than .pfa.  (fontmap.gs)
	- Fonts whose FontBBox was [0 0 0 0] were not displayed, or were
displayed as tiny dots.  (gs_type1.ps)

</pre><h3><a name="V3.01_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- dict_put could read from the variable pvslot before it was used.
(This was harmless, since the value was never actually used; it just upset
Purify.)  (idict.c)
	- Binary object sequences could cause addressing faults.
(iscanbin.c)
	- The attributes on names were set incorrectly in binary object
sequences.  (iscanbin.c)
	- gs.c duplicated (in some cases incorrectly) some definitions in
interp.h.  (gs.c)
	- gs_lib_paths was declared const in one place and non-const in
another.  (zfile.c)
	- file_restore and font_restore had inconsistent const declarations
for their argument.  (isave.c)
	- iodev_os_open_file was missing its last formal parameter.
(ziodev.c)
	- gs.c declared gs_devicename with an incorrect extern.  (gs.c)
	- undefinefont didn't interact properly with the resource
machinery.  (gs_lev2.ps)
	- The declaration for swap_entry used a typedef name as a formal
parameter, which upset some compilers.  (zmisc2.c)
	- Including the ccinit feature could cause the garbage collector to
make an invalid access.  (stream.c)
	- The check for t_[a]struct types in ztype.c was incorrect.
(ztype.c)
	- After the collection of halftone samples, temporary data
structures were freed incorrectly.  (gzht.h, gsht1.c, zht.c)
	- Images with source width between 489 and 492 crashed the
memory manager.  (iastate.h)

Makes it possible to define SEARCH_HERE_FIRST (gsmain.c) in the makefile.
(gsmain.c)

Splits the Level 2 resource machinery into a separate file.  (gs_lev2.ps,
gs_res.ps, gs.mak, unix-end.mak, vms.mak).

Changes the names of the DiffEncode/Decode filters to
PixelDifferenceEncode/Decode, and splits them off into a separate
"feature".  (gs.mak, zfilter2.c, zfpdiff.c, spdiff.c, spdiffx.h)

Adds experimental code for filtered image scaling.  DON'T USE THIS CODE.
(zimage2.c)

</pre><h3><a name="V3.01_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- The CCITTFaxEncode filter could put out an EOB in the middle of
the data.  (scfe.c)

Splits off the PixelDifferenceEncode/Decode filters into a separate
"feature".  (gs.mak)

</pre><h3><a name="V3.01_Library"></a>Library</h3><pre>

Fixes bugs:
	- gs_setcachedevice could return a garbage error code.  (gschar.c)
	- joins on stroked lines were incorrect if the device coordinate
system mapped +Y to +Y.  (gxstroke.c)
	- If gsmisc.c supplied versions of missing library routines, they
could clash with the names of the real ones if those were present
unexpectedly.  (memory_.h, gsmisc.c)
	- The initialization expression for is_open in the
dev_init_misc_open macro included a cast, which some compilers don't allow.
(gxdevice.h, gsdevice.c, gxclip2.c, gxpcmap.c)
	- In Type 1 fonts, character that specified their side bearing and
width with sbw rather than hsbw gave an invalidfont error.  (gstype1.c)
	- Some procedures were declared inconsistently with regard to const
arguments.  (gscie.c, gxpcmap.c, gxacpath.c, gxcmap.c)
	- A few places still assumed that pointers occupied 4 bytes.
(gxclist.c)
	- Rendering a gray halftone on a CMYK device called the device's
map_rgb_color procedure instead of map_cmyk_color.  (gxdither.c)

Renames gsfile.c as gswppm.c.  (gsfile.c, gswppm.c)

Implements the ability to cache arbitrarily transformed characters.  This
is currently enabled by a compile-time flag in gschar.c.  (gschar.c)

</pre>

<h2><a name="Version3.0"></a>Version 3.0 (8/1/94)</h2>

<p>
This is the first full Level 2 version released to the public.
Unfortunately, we were not able to include setpagedevice in this release.

<h3><a name="V3.0_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- README didn't mention Aladdin's European distributor.
	- psfiles.doc didn't describe some of the newer gs_*.ps files.

Notes that gcc -O2 (version 2.5.8 of gcc) generates incorrect code for some
modules on the H-P RISC architecture.

Notes that on AXP platforms running VMS, DEC C V4.0 is required.

</pre><h3><a name="V3.0_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- 'make clean' didn't delete devs.tr or t.tr.
	- devs.mak was missing the entry for faxg32d.
	- unixansi.mak omitted some drivers that were included in
unix-cc.mak and unix-gcc.mak.

Updates jpeg.mak to reference version 5beta1 of the IJG JPEG code.

Changes the version numbering scheme from A.B.C to A.B[CC].  I.e., the
first sub-release after 3.0 will be 3.01 or 3.001, not 3.0.1.

</pre><h3><a name="V3.0_Utilities"></a>Utilities</h3><pre>

Fixes bugs:
	- ps2ascii didn't do a setglobal.

Adds an option to ansi2knr to convert ... to va_alist/va_dcl.

</pre><h3><a name="V3.0_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The newly added faxg32d driver didn't have an entry in devs.mak.
	- The BMP, GIF, and PCX drivers wrote out an incorrect color
palette (the blue values were too small).
	- The vgalib driver had some compilation problems.
	- The TIFF drivers didn't produce correct multi-page output.

Adds faxg32d and tiffg32d drivers.

Reinstates the DigiFax drivers, which were withdrawn when the new fax
drivers were added.

</pre><h3><a name="V3.0_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- gs_btokn.ps and gs_ccfnt.ps weren't installed on Unix platforms.
	- The VMS module list omitted SBHC, included a non-existent GXDASH,
and had incorrect names for some of the IJG JPEG files.
	- The VMS build scripts (vms*.mak) had incorrect "boilerplate".
	- The VMS script file gssetmod.com had \r characters in it, as well
as \n characters.
	- The echogs and genarch utilities didn't return the correct exit
codes under VMS.
	- The VMS Fontmap had incorrect entries for the Courier and Charter
fonts.
	- When running under Ghostview, Ghostscript didn't drain the input
pipe.  (We fixed this with a temporary patch in gs.c; this isn't a good
solution for the longer term.)

</pre><h3><a name="V3.0_Fonts"></a>Fonts</h3><pre>

Fixes bugs:
	- The free AvantGarde, Bookman, and Palatino font families had
incorrect FontBBox values.
	- The 'f' and 'j' in the free AvantGarde-DemiOblique,
Bookman-DemiItalic, Bookman-LightItalic, and Palatino-Italic fonts were
chopped off on the right.  (The bitmaps were chopped off in the original
BDF fonts from which these fonts were made.)  ****** THIS PROBLEM WAS NOT
ACTUALLY FIXED. ******

</pre><h3><a name="V3.0_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- gs -h and gs -v didn't print the tertiary version number correctly.
	- Binary object sequences with no strings or names didn't read in
correctly.
	- Binary object sequences that crossed an input buffer boundary
didn't read in correctly.
	- Binary object sequences read in as {[e1 .. en] e1 ... en} instead
of {[e1 ... en]}.  (New bug in 2.9.x.)
	- setpattern didn't set the current color space correctly if the
current color space wasn't a Pattern space.
	- If the current color space was an uncolored Pattern space but the
current color was a colored Pattern, currentcolor returned extra values on
the operands stack.
	- .buildfont1 in gs_type1.ps didn't force binding of the old
definition, causing ps2ascii to loop endlessly.

Adds a facility for writing and reading dictionaries in binary object
sequences.  This is experimental and subject to change in the future.

</pre><h3><a name="V3.0_Streams"></a>Streams</h3><pre>

Fixes bugs:
	- gs_run_string and ccinit didn't have any way to mark the string
as "foreign", which confused the GC.

</pre><h3><a name="V3.0_Library"></a>Library</h3><pre>

Fixes bugs:
	- gxchar.h had an extra comma after the last element of the
show_width_status enum, which upset some compilers.
	- stroke and strokepath didn't correctly skip zero-length segments
if the line width was less than one pixel, or if there was a closed subpath
consisting entirely of zero-length segments.
	- strokepath sometimes incorrectly added a moveto at the end of the
path.
</pre>

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 1996, 1997, 1998 Aladdin Enterprises.
All rights reserved.</small>

<p>
This software is provided AS-IS with no warranty, either express or
implied.

This software is distributed under license and may not be copied,
modified or distributed except as expressly authorized under the terms
of the license contained in the file LICENSE in this distribution.

For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA  94903, U.S.A., +1(415)492-9861.

<p>
<small>Ghostscript version 8.12, 8 December 2003


<!-- [3.0 end visible trailer] ============================================= -->

</body>
</html>
13eca2c6b601ed
93feabc62de7a6c2ff51cba1ff6cf99edb06feaff567fe09f6a020feac27e0afc0ff51f4
34fa62d0b181de78edcc14ffd05affa6f893fe52d21fe498d6be6af3cb8e5fe5a8ff71f8
9bda8a06ffc387ed33dd3ef24efbc09ff9b384d97ae5cd6dfed186ef0fa0cfff4bf7af2e
fd6df7c95ddbae3affbf1fd0aff367b7e806c2df1fd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>History of Ghostscript versions 4.n</title>
<!-- $Id: History4.htm,v 1.29 2003/12/08 23:17:15 giles Exp $ -->
<!-- Originally: history4.txt -->
<!--
	WARNING: do not use Pete Kaiser's emacs function "gs-toc" alone to
	re-create the table of contents here, because it will replace the
	hand-edited TOC subheads with a separate subhead for each H2 in
	the body of the file.  Or if you do, first look at the original
	TOC to see how to edit it for visual conciseness.
-->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>History of Ghostscript versions 4.n</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#Version4.81">Version 4.81 (6/1/97)</a>
<ul>
<li><a href="#V4.81_Documentation">Documentation</a>,
    <a href="#V4.81_Procedures">Procedures</a>,
    <a href="#V4.81_Utilities">Utilities</a>,
    <a href="#V4.81_Drivers">Drivers</a>,
    <a href="#V4.81_Platforms">Platforms</a>,
    <a href="#V4.81_Interpreter">Interpreter</a>,
    <a href="#V4.81_Library">Library</a>
</ul>
<li><a href="#Version4.80">Version 4.80 (limited) (5/28/97)</a>
<ul>
<li><a href="#V4.80_Documentation">Documentation</a>,
    <a href="#V4.80_Procedures">Procedures</a>,
    <a href="#V4.80_Utilities">Utilities</a>,
    <a href="#V4.80_Drivers">Drivers</a>,
    <a href="#V4.80_Platforms">Platforms</a>,
    <a href="#V4.80_Fonts">Fonts</a>,
    <a href="#V4.80_Interpreter">Interpreter</a>,
    <a href="#V4.80_Streams">Streams</a>,
    <a href="#V4.80_Library">Library</a>
</ul>
<li><a href="#Version4.74">Version 4.74 (limited) (5/5/97)</a>
<ul>
<li><a href="#V4.74_Documentation">Documentation</a>,
    <a href="#V4.74_Utilities">Utilities</a>,
    <a href="#V4.74_Drivers">Drivers</a>,
    <a href="#V4.74_Interpreter">Interpreter</a>,
    <a href="#V4.74_Streams">Streams</a>,
    <a href="#V4.74_Library">Library</a>
</ul>
<li><a href="#Version4.73">Version 4.73 (limited) (4/19/97)</a>
<ul>
<li><a href="#V4.73_Documentation">Documentation</a>,
    <a href="#V4.73_Procedures">Procedures</a>,
    <a href="#V4.73_Utilities">Utilities</a>,
    <a href="#V4.73_Drivers">Drivers</a>,
    <a href="#V4.73_Platforms">Platforms</a>,
    <a href="#V4.73_Interpreter">Interpreter</a>,
    <a href="#V4.73_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.73_Streams">Streams</a>,
    <a href="#V4.73_Library">Library</a>
</ul>
<li><a href="#Version4.72">Version 4.72 (limited) (4/14/97)</a>
<ul>
<li><a href="#V4.72_Documentation">Documentation</a>,
    <a href="#V4.72_Procedures">Procedures</a>,
    <a href="#V4.72_Drivers">Drivers</a>,
    <a href="#V4.72_Platforms">Platforms</a>,
    <a href="#V4.72_Interpreter">Interpreter</a>,
    <a href="#V4.72_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.72_Streams">Streams</a>,
    <a href="#V4.72_Library">Library</a>
</ul>
<li><a href="#Version4.71">Version 4.71 (limited) (3/31/97)</a>
<ul>
<li><a href="#V4.71_Documentation">Documentation</a>,
    <a href="#V4.71_Procedures">Procedures</a>,
    <a href="#V4.71_Drivers">Drivers</a>,
    <a href="#V4.71_Interpreter">Interpreter</a>,
    <a href="#V4.71_Streams">Streams</a>,
    <a href="#V4.71_Library">Library</a>
</ul>
<li><a href="#Version4.70">Version 4.70 (limited) (3/26/97)</a>
<ul>
<li><a href="#V4.70_Documentation">Documentation</a>,
    <a href="#V4.70_Procedures">Procedures</a>,
    <a href="#V4.70_Drivers">Drivers</a>,
    <a href="#V4.70_Platforms">Platforms</a>,
    <a href="#V4.70_Interpreter">Interpreter</a>,
    <a href="#V4.70_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.70_Streams">Streams</a>,
    <a href="#V4.70_Library">Library</a>
</ul>
<li><a href="#Version4.61">Version 4.61 (limited) (3/13/97)</a>
<ul>
<li><a href="#V4.61_Documentation">Documentation</a>,
    <a href="#V4.61_Procedures">Procedures</a>,
    <a href="#V4.61_Drivers">Drivers</a>,
    <a href="#V4.61_Platforms">Platforms</a>,
    <a href="#V4.61_Interpreter">Interpreter</a>,
    <a href="#V4.61_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.61_Streams">Streams</a>,
    <a href="#V4.61_Library">Library</a>
</ul>
<li><a href="#Version4.60">Version 4.60 (limited) (3/2/97)</a>
<ul>
<li><a href="#V4.60_Documentation">Documentation</a>,
    <a href="#V4.60_Procedures">Procedures</a>,
    <a href="#V4.60_Drivers">Drivers</a>,
    <a href="#V4.60_Platforms">Platforms</a>,
    <a href="#V4.60_Fonts">Fonts</a>,
    <a href="#V4.60_Interpreter">Interpreter</a>,
    <a href="#V4.60_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.60_Streams">Streams</a>,
    <a href="#V4.60_Library">Library</a>
</ul>
<li><a href="#Version4.51">Version 4.51 (limited) (2/9/97)</a>
<ul>
<li><a href="#V4.51_Procedures">Procedures</a>,
    <a href="#V4.51_Drivers">Drivers</a>,
    <a href="#V4.51_Platforms">Platforms</a>,
    <a href="#V4.51_Interpreter">Interpreter</a>,
    <a href="#V4.51_Streams">Streams</a>,
    <a href="#V4.51_Library">Library</a>
</ul>
<li><a href="#Version4.50">Version 4.50 (limited) (1/31/97)</a>
<ul>
<li><a href="#V4.50_Documentation">Documentation</a>,
    <a href="#V4.50_Procedures">Procedures</a>,
    <a href="#V4.50_Drivers">Drivers</a>,
    <a href="#V4.50_Platforms">Platforms</a>,
    <a href="#V4.50_Interpreter">Interpreter</a>,
    <a href="#V4.50_Streams">Streams</a>,
    <a href="#V4.50_Library">Library</a>
</ul>
<li><a href="#Version4.41">Version 4.41 (private) (1/21/97)</a>
<ul>
<li><a href="#V4.41_Procedures">Procedures</a>,
    <a href="#V4.41_Drivers">Drivers</a>,
    <a href="#V4.41_Fonts">Fonts</a>,
    <a href="#V4.41_Interpreter">Interpreter</a>,
    <a href="#V4.41_Streams">Streams</a>,
    <a href="#V4.41_Library">Library</a>
</ul>
<li><a href="#Version4.40">Version 4.40 (private) (1/13/97)</a>
<ul>
<li><a href="#V4.40_Documentation">Documentation</a>,
    <a href="#V4.40_Utilities">Utilities</a>,
    <a href="#V4.40_Drivers">Drivers</a>,
    <a href="#V4.40_Interpreter">Interpreter</a>,
    <a href="#V4.40_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.40_Library">Library</a>
</ul>
<li><a href="#Version4.39">Version 4.39 (limited) (1/1/97)</a>
<ul>
<li><a href="#V4.39_Documentation">Documentation</a>,
    <a href="#V4.39_Procedures">Procedures</a>,
    <a href="#V4.39_Utilities">Utilities</a>,
    <a href="#V4.39_Drivers">Drivers</a>,
    <a href="#V4.39_Interpreter">Interpreter</a>,
    <a href="#V4.39_Streams">Streams</a>,
    <a href="#V4.39_Library">Library</a>
</ul>
<li><a href="#Version4.38">Version 4.38 (limited) (12/20/96)</a>
<ul>
<li><a href="#V4.38_Interpreter">Interpreter</a>,
    <a href="#V4.38_Streams">Streams</a>,
    <a href="#V4.38_Library">Library</a>
</ul>
<li><a href="#Version4.37">Version 4.37 (limited) (12/10/96)</a>
<ul>
<li><a href="#V4.37_Fonts">Fonts</a>,
    <a href="#V4.37_Interpreter">Interpreter</a>,
    <a href="#V4.37_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.37_Library">Library</a>
</ul>
<li><a href="#Version4.36">Version 4.36 (limited) (12/3/96)</a>
<ul>
<li><a href="#V4.36_Documentation">Documentation</a>,
    <a href="#V4.36_Drivers">Drivers</a>,
    <a href="#V4.36_Interpreter">Interpreter</a>,
    <a href="#V4.36_Library">Library</a>
</ul>
<li><a href="#Version4.35">Version 4.35 (limited) (11/24/96)</a>
<ul>
<li><a href="#V4.35_Documentation">Documentation</a>,
    <a href="#V4.35_Procedures">Procedures</a>,
    <a href="#V4.35_Interpreter">Interpreter</a>,
    <a href="#V4.35_Streams">Streams</a>,
    <a href="#V4.35_Library">Library</a>
</ul>
<li><a href="#Version4.34">Version 4.34 (limited) (11/18/96)</a>
<ul>
<li><a href="#V4.34_Documentation">Documentation</a>,
    <a href="#V4.34_Procedures">Procedures</a>,
    <a href="#V4.34_Drivers">Drivers</a>,
    <a href="#V4.34_Interpreter">Interpreter</a>,
    <a href="#V4.34_Streams">Streams</a>,
    <a href="#V4.34_Library">Library</a>
</ul>
<li><a href="#Version4.33">Version 4.33 (limited) (11/6/96)</a>
<ul>
<li><a href="#V4.33_Documentation">Documentation</a>,
    <a href="#V4.33_Procedures">Procedures</a>,
    <a href="#V4.33_Interpreter">Interpreter</a>,
    <a href="#V4.33_Library">Library</a>
</ul>
<li><a href="#Version4.32">Version 4.32 (limited) (11/1/96)</a>
<ul>
<li><a href="#V4.32_Documentation">Documentation</a>,
    <a href="#V4.32_Drivers">Drivers</a>,
    <a href="#V4.32_Platforms">Platforms</a>,
    <a href="#V4.32_Fonts">Fonts</a>,
    <a href="#V4.32_Interpreter">Interpreter</a>,
    <a href="#V4.32_Library">Library</a>
</ul>
<li><a href="#Version4.31">Version 4.31 (limited) (10/27/96)</a>
<ul>
<li><a href="#V4.31_Documentation">Documentation</a>,
    <a href="#V4.31_Procedures">Procedures</a>,
    <a href="#V4.31_Platforms">Platforms</a>,
    <a href="#V4.31_Interpreter">Interpreter</a>,
    <a href="#V4.31_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.31_Streams">Streams</a>,
    <a href="#V4.31_Library">Library</a>
</ul>
<li><a href="#Version4.30">Version 4.30 (limited) (10/23/96)</a>
<ul>
<li><a href="#V4.30_Documentation">Documentation</a>,
    <a href="#V4.30_Drivers">Drivers</a>,
    <a href="#V4.30_Platforms">Platforms</a>,
    <a href="#V4.30_Fonts">Fonts</a>,
    <a href="#V4.30_Interpreter">Interpreter</a>,
    <a href="#V4.30_Library">Library</a>
</ul>
<li><a href="#Version4.21">Version 4.21 (limited) (10/17/96)</a>
<ul>
<li><a href="#V4.21_Documentation">Documentation</a>,
    <a href="#V4.21_Procedures">Procedures</a>,
    <a href="#V4.21_Drivers">Drivers</a>,
    <a href="#V4.21_Platforms">Platforms</a>,
    <a href="#V4.21_Fonts">Fonts</a>,
    <a href="#V4.21_Interpreter">Interpreter</a>,
    <a href="#V4.21_Library">Library</a>
</ul>
<li><a href="#Version4.20">Version 4.20 (limited) (10/13/96)</a>
<ul>
<li><a href="#V4.20_Documentation">Documentation</a>,
    <a href="#V4.20_Procedures">Procedures</a>,
    <a href="#V4.20_Utilities">Utilities</a>,
    <a href="#V4.20_Drivers">Drivers</a>,
    <a href="#V4.20_Interpreter">Interpreter</a>,
    <a href="#V4.20_Library">Library</a>
</ul>
<li><a href="#Version4.10">Version 4.10 (limited) (9/25/96)</a>
<ul>
<li><a href="#V4.10_Documentation">Documentation</a>,
    <a href="#V4.10_Utilities">Utilities</a>,
    <a href="#V4.10_Drivers">Drivers</a>,
    <a href="#V4.10_Interpreter">Interpreter</a>,
    <a href="#V4.10_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.10_Library">Library</a>
</ul>
<li><a href="#Version4.03">Version 4.03 (9/23/96)</a>
<ul>
<li><a href="#V4.03_Documentation">Documentation</a>,
    <a href="#V4.03_Procedures">Procedures</a>,
    <a href="#V4.03_Drivers">Drivers</a>,
    <a href="#V4.03_Fonts">Fonts</a>,
    <a href="#V4.03_Streams">Streams</a>
</ul>
<li><a href="#Version4.02">Version 4.02 (9/19/96)</a>
<ul>
<li><a href="#V4.02_Documentation">Documentation</a>,
    <a href="#V4.02_Procedures">Procedures</a>,
    <a href="#V4.02_Utilities">Utilities</a>,
    <a href="#V4.02_Drivers">Drivers</a>,
    <a href="#V4.02_Platforms">Platforms</a>,
    <a href="#V4.02_Interpreter">Interpreter</a>,
    <a href="#V4.02_Interpreter_PDF">Interpreter (PDF)</a>,
    <a href="#V4.02_Streams">Streams</a>,
    <a href="#V4.02_Library">Library</a>
</ul>
<li><a href="#Version4.01">Version 4.01 (7/10/96)</a>
<ul>
<li><a href="#V4.01_Documentation">Documentation</a>,
    <a href="#V4.01_Procedures">Procedures</a>,
    <a href="#V4.01_Utilities">Utilities</a>,
    <a href="#V4.01_Platforms">Platforms</a>,
    <a href="#V4.01_Platforms">Platforms</a>,
    <a href="#V4.01_Interpreter">Interpreter</a>,
    <a href="#V4.01_Library">Library</a>
</ul>
<li><a href="#Version4.0">Version 4.0 (6/28/96)</a>
<ul>
<li><a href="#V4.0_Documentation">Documentation</a>,
    <a href="#V4.0_Procedures">Procedures</a>,
    <a href="#V4.0_Utilities">Utilities</a>,
    <a href="#V4.0_Drivers">Drivers</a>,
    <a href="#V4.0_Platforms">Platforms</a>,
    <a href="#V4.0_Interpreter">Interpreter</a>,
    <a href="#V4.0_Streams">Streams</a>,
    <a href="#V4.0_Library">Library</a>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>
This document is a history of Ghostscript releases numbered 4.n.  For more
recent changes, see the the other history documents and, for the latest
versions, the news:

<blockquote>
<a href="News.htm">News</a><br>
History of Ghostscript versions 4.n (this document)<br>
<a href="History3.htm">History of Ghostscript versions 3.n</a><br>
<a href="History2.htm">History of Ghostscript versions 2.n</a><br>
<a href="History1.htm">History of Ghostscript versions 1.n</a>
</blockquote>

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<h2><a name="Version4.81"></a>Version 4.81 (6/1/97)</h2>

<p>
This is a last-minute set of bug fixes before the 5.0 release.

<h3><a name="V4.81_Documentation"></a>Documentation</h3><pre>

Adds some overlooked helpers to the list.  (helpers.txt)

</pre><h3><a name="V4.81_Procedures"></a>Procedures</h3><pre>

Makes a distinction between 2-part and 3-digit version numbers.
(version.mak, vms.mak)

</pre><h3><a name="V4.81_Utilities"></a>Utilities</h3><pre>

Develops the Type 1 to CFF converter a little further; it is still NOT
USABLE.  (t1tot2.ps)

Removes the pstoppm.ps script, since the p*m drivers supersede it.
(pstoppm.ps, unix-end.mak)

</pre><h3><a name="V4.81_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- The PDF writer sometimes omitted an ET command before setting the
clip path.  (gdevpdf.c)
	- The PDF writer didn't initialize the "vector" state, leading to
some redundant output (performance bug only).  (gdevpdf.c)
	- The PDF writer wrote clip paths even when they included the entire
page (performance bug only).  (gdevpdf.c)

Changes the PDF writer so that it recognizes not only the 14 built-in fonts
but any font with the same UniqueID and metrics.  This covers some common
cases of re-registering a font with a variant Encoding.  (gs_pdfwr.ps)

</pre><h3><a name="V4.81_Platforms"></a>Platforms</h3><pre>

Fixes bugs:
	- SEARCH_HERE_FIRST was accidentally set to 0 on MS Windows
platforms.  (bcwin32.mak, msvc4.mak, msvc5.mak, watcw32.mak)

Adds code to remove "" around arguments in the command line passed to
WinMain (MS Windows platforms).  (dwmain.cpp, dwmainc.cpp)

</pre><h3><a name="V4.81_Interpreter"></a>Interpreter</h3><pre>

Fixes bugs:
	- setsystemparams was broken.  (gs_lev2.ps)
	- restore was broken if -dNOBIND was invoked.  (gs_dps1.ps)
	- deviceinfo returned much more information than it should.
(gs_dps.ps)
	- The fix for the default EndPage procedures not popping their page
count operand from the stack was wrong.  (gs_init.ps, gs_setpd.ps)

</pre><h3><a name="V4.81_Library"></a>Library</h3><pre>

Fixes bugs:
	- The saved character origin took the translation component of the
FontMatrix into account, which caused charpath on fonts with non-zero
translation in the FontMatrix to produce incorrect results.  (gschar.c)

Removes incorrect access attributes on a couple of files.  (gdevpdfm.c,
gxclist.h)

</pre>

<h2><a name="Version4.80"></a>Version 4.80 (limited) (5/28/97)</h2>

<p>
This is the candidate fileset for the 5.0 release.

<h3><a name="V4.80_Documentation"></a>Documentation</h3><pre>

Fixes bugs:
	- The one-line description of the color image rendering module was
incorrect.  (gximage3.c)
	- Some of the VMS documentation was out of date.  (make.txt,
use.txt)
	- The description of the file name separator for -sFONTMAP= was
wrong.  (use.txt)
	- PSFile was misspelled PSfile.  (use.txt)
	- There were some minor typos.  (gstype1.h)
	- The build instructions had a lot of obsolete information for PC
environments, and didn't cover Microsoft Visual C++.  (make.txt)

Explains that -sPAPERSIZE= only specifies the default papersize, and that
forcing a particular paper size also requires -dFIXEDMEDIA.  (use.txt)

Adds information about building with GNU make on OpenVMS.  (make.txt)

Clarifies the meaning of EOFC for streams.  (strimpl.h)

Documents the new dictionary argument for the eexecDecode filter.
(language.doc)

</pre><h3><a name="V4.80_Procedures"></a>Procedures</h3><pre>

Fixes bugs:
	- gs_epsf.ps didn't get installed on Unix systems.  (unix-end.mak)
	- The code wouldn't build with libpng 0.95b.  (libpng.mak)
	- One of the VMS scripts used CC_QUAL instead of CC_DEF.
(vms-cc.mak)
	- version.mak wasn't included in a dependency list.  (unix-end.mak)

Brings the VMS DCL script up to date again (for the last time, we hope).
(vms.mak)

Modifies all platform-independent uses of upper-case command line arguments
to deal properly with VMS, where the shell converts all command line
arguments to lower case, without requiring quotation.  (devs.mak, gs.mak,
int.mak, lib.mak, zlib.mak)

Moves the compilation rules for the third-party libraries into gs.mak, so
they can be used to compile the callers as well.  (gs.mak, jpeg.mak,
libpng.mak, zlib.mak)

Adds a set of files that allow building on OpenVMS using GNU make (slightly
patched).  The timing on this is unfortunate, but we've wanted this for a
very long time.  NOTE: be sure to look in the OpenVMS section of make.txt
for information on patching GNU make.  (openvms.mak, append_l.com,
rm_all.com, rm_one.com, copy_one.com)

Adds new makefiles for building on 32-bit Windows with Borland, Watcom, and
Microsoft Visual C++ (versions 4.x and 5.0).  The timing on this is
unfortunate too, but having this capability is so important that we couldn't
pass it up.  (bcwin32.mak, msvc4.mak, msvc5.mak, msvccom.mak, watcw32.mak,
wincom.mak)

Removes now-obsolete makefiles.  (dwcommon.mak, msc.mak, msvcwint.mak,
mscbegin.bat, watcwin.mak)

</pre><h3><a name="V4.80_Utilities"></a>Utilities</h3><pre>

Extends echogs to work in VMS environments, where the shell converts all
command line arguments to lower case, without requiring quotation.
(echogs.c)

Adds a sketch of a utility for converting Type 1 fonts to CFF.  DOESN'T WORK
YET: DON'T TRY TO USE IT.  (t1tot2.ps, type1ops.ps, writecff.ps)

</pre><h3><a name="V4.80_Drivers"></a>Drivers</h3><pre>

Fixes bugs:
	- A type declaration wasn't compatible with libpng 0.95.
(gdevpng.c)
	- kshow wasn't handled properly when producing PDF output.
(gs_pdfwr.ps)
	- The PDF writer put out unnecessary ET/BT commands.  (gdevpdfx.h,
gdevpdf.c, gdevpdfi.c, gdevpdfm.c, gdevpdft.c)
	- The PCL XL writer put out real numbers for the miter limit, which
are not allowed (!).  (gdevpx.c)
	- The PCL XL writer didn't combine successive curves into a single
curve command (performance bug only).  (gdevpx.c)
	- The PCL XL writer could write uncompressed images with a tag
saying they were compressed.  (gdevpx.c)
	- The PCL XL writer always selected U.S. letter paper, rather than
the requested size.  (gdevpxen.h, gdevpx.c)
	- The PCL XL writer reselected the paper size on every page, even if
it hadn't changed.  (gdevpx.c)
	- The PCL XL writer always used shorts for line and curve
coordinates, rather than using bytes when possible (performance bug only).
(gdevpx.c)
	- Because of a compiler bug, a macro with argument conflicted with a
variable name.  (gdevpdfx.h, gdevpdf.c)
	- A picky compiler objected to an extern for an undefined structure.
(gdevpsdf.h)
	- The PDF writer sometimes didn't reset the clipping path, causing
bitmaps or rectangle to disappear.  (gdevpdf.c, gdevpdfi.c)
	- The PDF writer produced invalid output if the first page was
blank.  (gdevpdf.c)
	- The AutoRotatePages parameter for PostScript and PDF output (which
doesn't actually do anything yet) incorrectly expected a Boolean value
rather than an enumeration.  (gdevpsdf.h, gdevpsdf.c)
	- Some places returned -1 for an error without calling gs_note_error
or gs_return_error.  (gdevm1.c, gdevmpla.c, gdevrun.c, gxclpath.c)
	- The PCL XL writer produced extremely large files because it didn't
download character bit